doc-src/Codegen/Thy/examples/lookup.ML
author haftmann
Thu, 28 Jan 2010 11:48:49 +0100
changeset 34974 18b41bba42b5
parent 30226 2f4684e2ea95
permissions -rw-r--r--
new theory Algebras.thy for generic algebraic structures

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*)