doc-src/Codegen/Thy/examples/lookup.ML
author haftmann
Sat, 24 Dec 2011 15:53:10 +0100
changeset 45970 b6d0cff57d96
parent 30226 2f4684e2ea95
permissions -rw-r--r--
adjusted to set/pred distinction by means of type constructor `set`

structure ROOT = 
struct

structure Codegen = 
struct

fun lookup ((k, v) :: xs) l =
  (if ((k : string) = l) then SOME v else lookup xs l)
  | lookup [] l = NONE;

end; (*struct Codegen*)

end; (*struct ROOT*)