Skip to content

Instantly share code, notes, and snippets.

@calebh
Created July 20, 2019 22:45
Show Gist options
  • Save calebh/0cda659b8ba3382a2ed531bf02ca1590 to your computer and use it in GitHub Desktop.
Save calebh/0cda659b8ba3382a2ed531bf02ca1590 to your computer and use it in GitHub Desktop.
type ErrorMessage = Lazy<string>
type Constraint = Equal of TyExpr * TyExpr * ErrorMessage
| And of Constraint * Constraint
| Trivial
let (=~=) q1 q2 err = Equal (q1, q2, err)
let (&&&) c1 c2 = And (c1, c2)
let rec conjoinConstraints cc =
match cc with
| [] -> Trivial
| [c] -> c
| c::cs -> c &&& (conjoinConstraints cs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment