Difference between revisions of "GHC/Type system"
< GHC
Jump to navigation
Jump to search
BrettGiles (talk | contribs) m (Link, headings) |
(fix link to OverlappingInstances) |
||
(19 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
+ | [[Category:GHC|Type system]] |
||
<span style='font-size: x-large; font-weight: bold'>Type system extensions in GHC</span> |
<span style='font-size: x-large; font-weight: bold'>Type system extensions in GHC</span> |
||
− | GHC comes with a rather large collection of type-system extensions (beyond Haskell 98). |
+ | GHC comes with a rather large collection of type-system extensions (beyond Haskell 98). {{GHCUsersGuide|exts||a section on Language Extensions}} But this page is a place to record user-oriented observations, notes, and suggestions on how to use them. |
+ | * '''[[GHC/Indexed_types|Indexed data types]]''' |
||
− | == Overlapping instances == |
||
+ | * '''[[GHC/TypeHoles|Agda-like "holes" in GHC]]''' |
||
− | |||
⚫ | |||
− | Here an [http://www.haskell.org//pipermail/glasgow-haskell-bugs/2006-July/006808.html interesting message] about the interaction of existential types and overlapping instances. |
||
+ | * '''[[GHC/TypeSigsAndAmbiguity|Type signatures and ambiguity]]''' |
||
− | |||
+ | * '''Overlapping instances'''. GHC supports overlapping instances, with carefully specified rules. Make sure you read the [http://downloads.haskell.org/~ghc/latest/docs/html/users_guide/exts/instances.html#overlapping-instances relevant sections of the user manual]. Here is an application note about [[GHC/AdvancedOverlap|advanced use of overlapping instances]], combined with functional dependencies. |
||
− | == Indexed data types and indexed newtypes == |
||
+ | * '''[[GHC/SuperClass|Super-Class Constraints: Type Families, Type Equalities, FunDep, Overlaps]]''' |
||
− | |||
+ | * '''[[GHC/Coercible|Safe coercions using Coercible]]''' |
||
− | [[GHC/Indexed_types|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 [http://hackage.haskell.org/trac/ghc/wiki/Building/GettingTheSources its source repository]. |
||
− | |||
− | == Stand-alone deriving clauses == |
||
− | |||
⚫ | |||
− | ----------------------- |
Latest revision as of 20:32, 23 July 2021
Type system extensions in GHC
GHC comes with a rather large collection of type-system extensions (beyond Haskell 98). The GHC Users Guide has a section on Language Extensions. But this page is a place to record user-oriented observations, notes, and suggestions on how to use them.
- Indexed data types
- Agda-like "holes" in GHC
- "Stand-alone deriving" declarations
- Type signatures and ambiguity
- Overlapping instances. GHC supports overlapping instances, with carefully specified rules. Make sure you read the relevant sections of the user manual. Here is an application note about advanced use of overlapping instances, combined with functional dependencies.
- Super-Class Constraints: Type Families, Type Equalities, FunDep, Overlaps
- Safe coercions using Coercible