Lesezeichen

Tom's Declarative Languages Blog: Type Invariants for Haskell


Beschreibung

Tom Schrijvers, Louis-Julien Guillemette, Stefan Monnier Abstract Haskell's multi-parameter type classes, together with functional dependencies, allow the specification of complex type-level operations, and the recent introduction of open type families in GHC makes such type-level programming even more accessible and flexible. But type-level code is special in that its correctness is crucial to the safety of the program; so except in those cases simple enough for the type checker to see trivially that the code is correct (or harmless), type-level programs need to come with their specification and correctness proof. In this article, we propose an extension to Haskell that allows the specification of invariants for type classes and open type families, together with accompanying evidence that those invariants hold. To accommodate the open nature of type classes and type families, the evidence itself needs to be open

Vorschau

Tags

Nutzer

  • @draganigajic

Kommentare und Rezensionen