Modular, composable, typed optimizations in the tagless-final style
okmij.org
okmij.org
The OCaml language features that are used that would need to be emulated somehow in Java:
* Sum types (type a = A of int | B of float). Think tagged unions [1].
* Module functors (module NAME(PARAM : MODULE_TYPE) = struct ... end). Think package level functions (you get some of this with dependency injection frameworks, but it's probably no-where near as safe/sane and flexible.
* GADTs (type a = A : int -> int | int term). I'm not sure how you would represent these in java, I'm not fully up to speed on how they work yet.