Serokell's GHC team reports major progress on bringing dependent types to Haskell in GHC 9.14. Three headline contributions are covered: (1) Visible forall in GADTs via the RequiredTypeArguments extension, enabling data constructors that take explicit type arguments like `Typed Int 42`; (2) Namespace-specified imports with new `type ..` and `data ..` wildcard syntax to disambiguate type vs. data constructor names; (3) A long-awaited fix (10 years in the making) for type instance ordering in kind checking, using a trial-and-error algorithm that eliminates the need for `$(return [])` workarounds. Additional improvements include progress on unifying HsType and HsExpr AST representations, star kind syntax support in required type arguments, pun detection in required type arguments, new type families (Tuple, Constraints, Tuple#, Sum#), and a rework of name resolution for built-in and punned names.

23m read timeFrom serokell.io
Post cover image
Table of contents
SummaryVisible forall in GADTsNamespace-specified importsType instances in kind checkingProgress on unifying HsType and HsExprThe star kind syntax in required type argumentsPun detection in required type argumentsNew type families: Tuple , Constraints , Tuple# , Sum#Rework of name resolution for built-in and punned namesPrevious updates on dependent typesConclusion
45 Impressions