rossberg / hamlet Goto Github PK
View Code? Open in Web Editor NEWSML reference interpreter
Home Page: https://www.mpi-sws.org/~rossberg/hamlet/
SML reference interpreter
Home Page: https://www.mpi-sws.org/~rossberg/hamlet/
The following program should print Hello world!
:
structure Foo = struct
structure Bar = struct
val x = "Hello"
end
val x = 42
val y = " world!\n"
end
open Foo Foo.Bar;
print (x ^ y);
but HaMLet (exec mode) gives
[loading standard basis library]
[processing open.sml]
structure Bar = struct val x = "Hello" : string end
structure Foo =
struct
structure Bar = struct val x = "Hello" : string end
val x = 42 : int
val y = " world!\n" : string
end
val x = 42 : string
val y = " world!\n" : string
open.sml:9.9-9.12: runtime type error: string expected
i.e. the dynamic interpretation of open
declaration is buggy with multiple longstrids.
In the manual (and Successor ML), the exprow after where
is marked optional.
However, the implementation requires exprow to be non-empty.
https://github.com/rossberg/hamlet/blob/master/doc/README.txt#L8 points to http://www.mpi-sws.org/hamlet/, which says "Page Not Found".
The following program is (correctly) rejected because the pattern is non-exhaustive:
let val { a = SOME f } = { a = SOME (fn x => x) }
in f 1;
f "x"
end;
But, a slight modification circumvents the exhaustiveness checker and allows the program to compile without a warning:
let val { ... = { a = SOME f } } = { a = SOME (fn x => x) }
in f 1;
f "x"
end;
The exhaustiveness checker should correctly handle ...
pattern.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.