Skip to content

Instantly share code, notes, and snippets.

@philnguyen
Last active December 22, 2015 20:09
Show Gist options
  • Save philnguyen/6524121 to your computer and use it in GitHub Desktop.
Save philnguyen/6524121 to your computer and use it in GitHub Desktop.
Example 14 from "Logical Types for Untyped Languages" translated to OCaml
type top = N of int | S of string
let f input extra =
match input,extra with
| N m, (N n,_) -> m + n
| _, (N n,_) -> (match input with
| S s -> String.length s + n)
| _,_ -> 0
let main i e = f i e
(* Error message received from MoCHi:
Verification result
Fatal error: Not implemented (Type_decl.get_base_types)
*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment