Add native build and compiler driver
This commit is contained in:
17 files changed
+833
No files matched your search
@@ -0,0 +1,26 @@
|
||||
# delta
|
||||
|
||||
OCaml compiler for a small pure functional language of keyed collection
|
||||
queries
|
||||
|
||||
Collections are unordered finite maps from signed machine integers to values.
|
||||
`map` preserves keys; `filter` keeps the keys of the rows it retains. Results
|
||||
are printed in key order, so presentation is deterministic
|
||||
|
||||
## Language
|
||||
|
||||
```ocaml
|
||||
type order = {
|
||||
customer : string;
|
||||
total : int;
|
||||
}
|
||||
|
||||
input orders : collection order
|
||||
|
||||
let tax n = n * 20 / 100
|
||||
|
||||
query expensive_orders =
|
||||
orders
|
||||
|> filter (fun o -> o.total > 1000)
|
||||
|> map (fun o -> (o.customer, tax o.total))
|
||||
```
|
||||
Reference in new issue
Block a user