From 264e81758fe4932f139819192302f4900ae1e447 Mon Sep 17 00:00:00 2001 From: Arnaud Bailly Date: Wed, 5 Nov 2025 13:43:11 +0100 Subject: add help panel to the REPL --- lambda-calcul/haskell/public/repl.html | 55 ++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) (limited to 'lambda-calcul/haskell/public/repl.html') diff --git a/lambda-calcul/haskell/public/repl.html b/lambda-calcul/haskell/public/repl.html index ee24236..a6c5e78 100644 --- a/lambda-calcul/haskell/public/repl.html +++ b/lambda-calcul/haskell/public/repl.html @@ -11,7 +11,7 @@ -

λ-Calculus Terminal

+

λ-Calculus Terminal ?

@@ -21,10 +21,61 @@
- +
+
+

Minilang REPL Help

+

This is a read-eval-print loop (REPL) for the Minilang λ-calculus interpreter.

+

Connecting to the Interpreter

+

Click the Connect Icon icon to connect to the interpreter. Once connected, the input box border will turn green.

+

Entering Commands

+

Type your Minilang commands into the input box and press Enter to execute them. The results will be displayed below. Available commands can be found by typing :help, the most important ones being:

+
+
:help
+
Display this help message.
+
:clear
+
Clear the REPL output and environment. All definitions will be removed.
+
:env
+
Display the current environment with all defined variables and their values.
+
:lang language
+
Switch the interpreter to the specified language mode. Supported values are Untyped or Typed. + By default the REPL is interpreting the untyped version.
+
+ +

Disconnecting

+

To disconnect from the interpreter, click the Disconnect Icon icon. The input box border will turn red.

+

Entering Programs

+

+ The left hand panel is a "terminal" for entering whole programs. Once you're happy with your program you can click on the Send + button, the program will be sent as is to the server and its evaluation result will appear below the command panel. +

+

Syntax

+

The syntax is based on s-expressions, e.g. like LISP, Scheme or Clojure. The semi-formal grammar of expressions (or <term>) is given by the following rules:

+
+
<symbol>
+
A symbol is a sequence of letters and some symbols ('-', '_', '*', '#', '%', '&', ':', '@', '/')
+ +
(<term> <term>+)
+
An application expression: needs at least 2 terms, and terms are applied from left to right.
+ +
(lam (<symbol>+) <term>)
+
An abstraction expression (ie. a function definition): needs at least 1 symbol
+
+

Beside expressions which are evaluated, one can enter definitions which augment the current environment and can be referred to by later expressions or definitions

+
+
(def <symbol> <term>)
+
Binds symbol to term in the current environment
+
+ +

Troubleshooting

+
    +
  • If you encounter connection issues, ensure that your internet connection is stable.
  • +
  • If commands are not executing, try reconnecting to the interpreter.
  • +
+
+ -- cgit v1.3.1