ref: 9209004fb786c313a4112b524d23d0a3109fef44
parent: b32d219fe46c5c143b4ebd6e98af56eb76ad6a0f
author: Lennart Augustsson <lennart@augustsson.net>
date: Wed Aug 30 07:48:04 EDT 2023
Add more docs.
--- a/README.md
+++ b/README.md
@@ -50,7 +50,7 @@
First, make sure the binaries are built. E.g., by doing `make test`.
Then compile the file by `bin/mhs -ilib Example` which produces `out.comb`.
-Finally, run the combinator file by `bin/eval +RTS -rout.comb`.
+Finally, run the combinator file by `bin/eval`.
This should produce
```
Some factorials
@@ -61,6 +61,15 @@
There are a number of libraries that have some of the standard Haskell functions.
But in general, the `Prelude` contains much, much less.
+## Types
+There two primitive data types `Int` and `Handle`. These are known by the runtime system
+and various primitive operations work on them. The runtime system also knows how lists
+are encoded. The function type, `->`, is also built in.
+
+All other types are defined with the language. They are converted to lambda terms using
+the Scott encoding.
+
+
## Compiler
The compiler is written in Micro Haskell.
It takes a name of a module and compiles it to a file called `out.comb`.
@@ -84,6 +93,7 @@
* `Main`, the main module. Decodes flags, compiles, and writes result.
* `Compile`, top level compiler. Maintains a cache of already compiled modules.
* `Exp`, simple expression type, combinator abstraction and optimization.
+* `Expr`, parsed expression type.
* `Desugar`, desugar full expressions to simple expressions.
* `Lex`, lexical analysis and indentation processing.
* `Parse`, parse and build and abstract syntax tree.
--
⑨