Created
July 20, 2019 23:11
-
-
Save calebh/835ce9d75297a05e6285bfa78ead4cbc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[<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