Overlapping and Undecidable and Incoherent, Oh My!
summary
GHC’s typeclass extensions are listed and demonstrated with real code: 16 extensions (six class, ten instance) with concrete examples like the String vs [Char] instance resolved by calling Data.Text.pack, functional dependencies to disambiguate multi-parameter classes, and flexible instances/contexts that let nested types compile. Practical warnings include the recursion limit 200 for undecidable instances and the strong recommendation to avoid overlapping and incoherent instances, with alternatives (closed type families, extra class methods, auxiliary classes, runtime type checks) shown.
AI-written summary · about
chapters (35)
- 0:00Intro
- 2:33Why Type Classes
- 3:25GHC
- 4:41User Guide
- 5:13MultiParameter Type Classes
- 6:07Example Class
- 7:28Flexible Context
- 9:10Constraint Class Methods
- 10:14Default Signature
- 11:32No parameter type classes
- 13:00Functional dependencies
- 14:59In practice
- 16:57Type synonym instances
- 17:58Flexible instances
- 18:12Inflexible contexts
- 18:57Instance resolution
- 19:41Patterson conditions
- 21:24Coverage condition
- 21:56Liberal coverage condition
- 22:53Undecidable instances
- 23:37Class synonyms
- 25:00Class synonyms in practice
- 26:43When to use
- 28:34Overlapping instances
- 30:57Incoherent instances
- 31:40Incoherent census
- 33:05Constraint searching rules
- 35:57Incoherence
- 39:39When to use overlapping
- 41:39Instant signatures
- 43:13Overlapping Labels
- 44:50Overloaded Lists
- 45:33Undecidable Super Classes
- 46:41Haskell 2010 Report
- 47:06Language Standard








