Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Lazyness in Ocaml with Syntax Extensions

LazySugar.ml provides force and delay operators implemented as synatic sugar using camlp5 preprocessor. This is completely useless since Ocaml already provides a Lazy module, but it was fun anyway :).

Delay and force can be expessed as syntactic sugar as follows:

equation

Usage

To compile LazySugar.ml:

$ ocamlc  -pp "camlp5o pa_extend.cmo q_MLast.cmo" -I +camlp5 -c LazySugar.ml

To use delay and force in an ocaml program, namely test.ml:

$ ocamlc -pp "camlp5o path/to/LazySugar.cmo" test.ml -o test

About

Lazyness in Ocaml with Syntax Extensions

Resources

Stars

5 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages