Open mlhaufe opened 1 year ago
Unification is currently implemented as a part of pattern matching in traits.
What if this was lifted into something more first class? What would it enable?
example:
const Point2 = Data({x: Number, y: Number}) const pt1 = Point2(12, _), pt2 = Point2(_, 3) const pt3 = unify(pt1, pt2) pt3 === Point2(12, 3)
With lazy fields this opens up even more interesting possibilities:
const foo = S({ left: _, right: () => foo })
Is there some logic programming functionality this enables?
Unification is currently implemented as a part of pattern matching in traits.
What if this was lifted into something more first class? What would it enable?
example: