Code for "Staged Generic Programming" (ICFP 2017)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
.gitignore
LICENSE
META
Makefile
README.md
_tags
myocamlbuild.ml
opam

README.md

Code from the paper

    Staged Generic Programming
    Jeremy Yallop
    ICFP 2017

Installation

opam switch 4.02.1+modular-implicits-ber
opam pin add metaocaml-syb https://github.com/yallop/staged-generic-programming.git

Usage

The following examples assume that you have loaded the package and brought the instances into scope:

# #require "metaocaml-syb";;
# open Metasyb_instances_;;
# open Metasyb_schemes_;;
# open Metasyb_instantiate;;
# open Partially_static;;
# implicit module P = PS_code_list(struct type t = int end);;

# (generateQps (listify_  (fun x -> .<.~x mod 2 = 0 >.))
    : ((int * bool option) list -> int list) code);;
  - : ((int * bool option) list -> int list) code = .<
let rec r_69 x_70 =
  match x_70 with
  | [] -> []
  | h_104::t_105 ->
      let (x_131,y_132) = h_104 in
      if (x_131 mod 2) = 0 then x_131 :: (r_69 t_105) else r_69 t_105 in
fun x_1  -> r_69 x_1>. 
;;