A compiler for a small pure functional query language
  • OCaml 98.4%
  • Makefile 1.5%
  • Common Lisp 0.1%
Find a file
2017-12-20 12:00:00 +00:00
bench Measure changed-key work on large collections 2017-06-22 12:11:00 +00:00
example Add typed wire input and native executable builds 2017-05-25 14:52:00 +00:00
runtime Add typed wire input and native executable builds 2017-05-25 14:52:00 +00:00
src Measure changed-key work on large collections 2017-06-22 12:11:00 +00:00
test Install runtime artifacts and verify external builds 2017-12-20 12:00:00 +00:00
.gitignore Install runtime artifacts and verify external builds 2017-12-20 12:00:00 +00:00
descr Add native build and compiler driver 2017-01-04 10:18:00 +00:00
Makefile Install runtime artifacts and verify external builds 2017-12-20 12:00:00 +00:00
opam Install runtime artifacts and verify external builds 2017-12-20 12:00:00 +00:00
README.md Add native build and compiler driver 2017-01-04 10:18:00 +00:00

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

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))