A walkthrough of using the purescript-heterogeneous library to simplify heterogeneous record mapping in PureScript. The post revisits a previous implementation of linear interpolation (lerp) over generic records, replacing a verbose hand-rolled approach with the MappingWithIndex type class from purescript-heterogeneous. The result is significantly less code while retaining full type safety and passing all existing unit tests.

4m read timeFrom galowicz.de
Post cover image

Sort: