Skip to content

Instantly share code, notes, and snippets.

@calebh
Created July 20, 2019 23:11
Show Gist options
  • Save calebh/835ce9d75297a05e6285bfa78ead4cbc to your computer and use it in GitHub Desktop.
Save calebh/835ce9d75297a05e6285bfa78ead4cbc to your computer and use it in GitHub Desktop.
[<EntryPoint>]
let main argv =
let solveAndCatch con =
try
printf "%A\n\n" (solve con)
with
| TypeError s ->
printf "%s" s
let t1 = tTuple [freshtyvar () |> TVarExpr; tNumber]
let t2 = tTuple [tUnit; freshtyvar () |> TVarExpr]
let con1 = (t1 =~= t2) (lazy ("Tuples aren't equal"))
solveAndCatch con1
let con2 = (tUnit =~= tNumber) (lazy ("Clearly unit isn't the same type as a number"))
solveAndCatch con2
0 // return an integer exit code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment