> - Chung-chieh Shan and Oleg's "Lightweight Static Capabilities" > presents several examples of phantom types and a general design method > to use them to enhance program safety: > http://okmij.org/ftp/papers/lightweight-static-capabilities.pdf
I attempted to read this one out of curiosity, and it raised a question: is there a way to write these unsafe functions (List.Unsafe.tail/head...) in pure OCaml? this code: let head (Cons (a, b)) = a would still generate code that check input constructor in order to raise an exception if it's not Cons (-unsafe command line parameter does not change this, regretably, according to the manual). Is there another way? -- Caml-list mailing list. Subscription management and archives: https://sympa-roc.inria.fr/wws/info/caml-list Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs