Get the latest tech news

Type-machine


Using Template Haskell to derive the structure of records and simulate structural subtyping

Alternatively, it is common to use heterogeneous lists to build records and work around the type system to simulate structural subtyping. This blog post presents the library’s features, shows a use-case with Servant and evaluates its impact both at compile time and runtime. The (somewhat ugly and unsatisfactory) workaround is to define a type of function whose parameters can be lifted in the TM monad.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Type-Machine

Type-Machine