Extensible*Rows
Like%duck%typing%only%be1er.
type Point r = { x :: Number, y :: Number | r }
-- | |
-- | |
-- 'remainder' syntax that means "the rest of the row"
gimmeX :: forall r. Point r -> Number
gimmeX p = p.x
gimmeX {x: 1, y: 2, z: 3} -- 1 - works!
-- gimmeX {x: 1, z: 3} -- Invalid, no x!