Personal tools

GHC/Type system

From HaskellWiki

< GHC
Revision as of 16:36, 31 October 2012 by Simonpj (Talk | contribs)

Jump to: navigation, search

Type system extensions in GHC

GHC comes with a rather large collection of type-system extensions (beyond Haskell 98). They are all documented in the user manual, but this page is a place to record observations, notes, and suggestions on them.


Contents

1 Overlapping instances

GHC supports overlapping instances, with carefully specified rules. Make sure you read the relevant sections of the user manual.

Here is an appliation note about advanced use of overlapping instances, combined with functional dependencies.

2 Indexed data types and indexed newtypes

Indexed data types (including associated data types) are a very recent addition to GHC's type system extensions that is not yet included in the user manual. To use the extension, you need to obtain a version of GHC from its source repository.

3 Stand-alone deriving clauses

Bjorn Bringert has recently implemented "stand-alone deriving" declarations.

4 Type holes

Simon Peyton Jones, Sean Leather and Thijs Alkemade implemented Agda-like "holes" in GHC, which will ship in GHC 7.8.1.