-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlocal_testing.html
28 lines (23 loc) · 1.63 KB
/
local_testing.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="index.css">
<title>LambdaLoc demonstration</title>
</head>
<body>
<h1>LambdaLoc demonstration</h1>
<div id="content">
<textarea id="system-input" class="panel" spellcheck="false">
val parse_version: string -> string
val show_major: string -> string
let appInfo = ("My Application", 1.5)
let process (name, vers) =
name ^ show_major (parse_version vers)
let test = process appInfo
</textarea>
<div id="system-output" class="panel"></div>
</div>
<script type="text/javascript" src="js/target/scala-2.13/hmloc-fastopt/main.js"></script>
<table><thead><tr><th><strong>Feature</strong></th><th><strong>Type syntax</strong></th><th><strong>Term syntax</strong></th></tr></thead><tbody><tr><td><strong>Basic terms and types</strong></td><td></td><td></td></tr><tr><td>literals</td><td>bool, string, int</td><td>true, false, 1, 2, "hello"</td></tr><tr><td>function</td><td>int -> int</td><td>fun x -> x + 1, fun (x, y) -> x + y</td></tr><tr><td>tuples</td><td>(int, int,)</td><td>(1, 2,)</td></tr><tr><td>application</td><td>F[A]</td><td>f a</td></tr><tr><td>variable</td><td>'a</td><td>x</td></tr><tr><td>let binding</td><td></td><td>let x = s in t</td></tr><tr><td>pattern matching</td><td></td><td>match t with C1(a, b, c) -> a | C2(a, b) -> b</td></tr><tr><td><strong>Top level declarations</strong></td><td></td><td></td></tr><tr><td>definition</td><td>val foo: T</td><td>def foo x = t</td></tr><tr><td>algebraic data type</td><td>type 'a list = Cons of ('a, 'a list) | Nil</td><td>Cons(1, Nil)</td></tr></tbody></table>
</html>