MENU

Fun & Interesting

@rae: Use closed type families for beautiful type inference

Tweag 2,442 lượt xem 4 years ago
Video Not Working? Fix It Now

In an attempt to get better type inference for field retrieval from deeply nested records, I use closed type families to help disambiguate among class instances. This is really useful for writing ergonomic embedded domain-specific languages.


Also: Tweag is hiring! https://boards.greenhouse.io/tweag


Code at end of video: https://github.com/goldfirere/video-resources/blob/main/2021-02-22-closed-type-family-trick/Records.hs


Find me at https://richarde.dev/ or on Twitter at @RaeHaskell

Comment