Use of language extensions

From HaskellWiki
Revision as of 08:13, 14 November 2006 by Lemming (talk | contribs) (taken from a Haskell-Cafe mail)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Haskell compilers are full of experimental features. However, when it comes to designing libraries one should carefully think about which extensions to use and which not. Every required language extension and every imported library which on its own depends on such an extension, causes some of the following problems:

  • It limits the range of Haskell compilers you can use.
  • According to the availability of compilers on different platforms, it will also limit the range of machines it can be run on.
  • It complicates the installation, if a user has to install a particular compiler to use your library.
  • Many extensions are complicated enough to produce even more incomprehensible error messages, than errorneous Haskell 98 programs.

We suggest the following hierarchy of complexity with respect to types:

  • Simple algebraic types
  • H98 type classes
  • Fancier instance heads (but still single-parameter, non-overlapping)
  • Existential and local universal quantification
  • GADTs (I'm still uncertain about this judgement, but they seem to be less troublesome than...)
  • Multiparameter type classes


See http://www.haskell.org/pipermail/haskell-cafe/2005-May/010085.html