IT lexicon › Programming › HKT (Higher-Kinded Types)

HKT (Higher-Kinded Types)

Programming På svenska → Updated: 2026-07-30

Type-system feature: abstract over type constructors (types that take types as parameters). Enables generic-over-generics: Functor F where F is any container type (List, Option, Tree).

Standard in Haskell, Scala. Foundation for typeclass-based abstraction: Monad, Functor, Applicative — all require HKT. Rust lacks HKT — many "Why Rust has no monads" discussions — replaced with GATs (Generic Associated Types) that address majority of use cases. TypeScript lacks — community workaround via fp-ts library. Mainstream language trade-off: HKT is intellectually clean but adds complexity for simple cases. Modern direction: Rust + Swift + Carbon choose to SKIP HKT explicitly.

← Back to the lexicon