Skip to content

Instantly share code, notes, and snippets.

@frenchy64
Created November 17, 2015 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frenchy64/e18f25cf9f33cb71cc9d to your computer and use it in GitHub Desktop.
Save frenchy64/e18f25cf9f33cb71cc9d to your computer and use it in GitHub Desktop.
Infer with Unchecked type

How to infer u as '{:a Num} in

(inc (:a u))

Step 1: Import u as type Unchecked(u)

Step 2: Return of (:a u) is Unchecked(key_:a(u))

Step 3: inc must take a Num, so must cast Unchecked(key_:a(u)) to Int.

Step 4: Therefore key_:a(u) == Int, so u : `'{:a Int}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment