Great moments in Haskell history

October 1988How to make ad-hoc polymorphism less ad hocHow to make ad-hoc polymorphism less ad hoc

The Haskell committee, unsatisfied with polymorphism in existing functional languages, sought a new approach for their new language. The answer, as it appears in Haskell 1.0, was put forth in this paper: type classes.

This research was specifically motivated by two examples: arithmetic operations and equality testing, corresponding to the Num and Eq classes respectively. Both of these classes were incorporated into Haskell and are still in use (with some additions) today.

The paper contrasts the proposed feature against two languages that existed at the time — Standard ML and Miranda — both of which have a similar syntax to Haskell and use the same Hindley/Milner type system.

To a modern Haskell user, the biggest deficiency of this initial incarnation of type classes is that it only permitted polymorphism over concrete types, not over type constructors. Once constructor classes appear eight years later in Haskell 1.3, the power of type classes will expand greatly.

Authors: Philip Wadler and Stephen Blott

April 1990Haskell 1.0

The first specificationHaskell 1.0 of Haskell, called the “Haskell Report”.

The preface explains where the idea came about:

In September of 1987 a meeting was held at the conference on Functional Programming Languages and Computer Architecture in Portland, Oregon, to discuss an unfortunate situation in the functional programming community: there had come into being more than a dozen non-strict, purely functional programming languages, all similar in expressive power and semantic underpinnings. There was a strong consensus at this meeting that more widespread use of this class of functional languages was being hampered by the lack of a common language. It was decided that a committee should be formed to design such a language, providing faster communication of new ideas, a stable foundation for real applications development, and a vehicle through which others would be encouraged to use functional languages.

It goes on to list the goals for the language, including among them:

The committee hopes that HASKELL can serve as a basis for future research in language design. We hope that extensions or variants of the language may appear, incorporating experimental features.

Indeed, the history of Haskell is a long saga full of extensions and experimental features.

The acknowledgements section includes a list of important influences on Haskell. “Without these forerunners Haskell would not have been possible”: Alonzo Church, J. Barkley Rosser, Haskell Curry, Lisp, Scheme, ISWIM, FP, ML, Hope, and Miranda.

The Report refers to its fifteen authors as “The Haskell Committee”: Paul Hudak, Philip Wadler, Arvind, Brian Boutel, Jon Fairbairn, Joseph Fasel, Kevin Hammond, John Hughes, Thomas Johnsson, Dick Kieburtz, Rishiyur Nikhil, Simon Peyton Jones, Mike Reeve, David Wise, and Jonathan Young.

August 1991Haskell 1.1Haskell 1.1

March 1992Haskell 1.2Haskell 1.2

This paper introduces constructor classes. Among its motivating examples are Functor and Monad. The language feature and these classes will be incorporated into Haskell 1.3.

Author: Mark P. Jones

June 1995 (?)GHC 0.29Documentation for GHC 0.29

August 1995Software Transactional MemorySoftware Transactional Memory

Although not specifically about Haskell, we mention this paper because it introduces the core of the idea eventually given in Composable memory transactions and brought to Haskell as the stm package with the release of GHC 6.4 in 2005.

Authors: Nir Shavit and Dan Touitou

May 1996Haskell 1.3Haskell 1.3

The role of typeclasses is significantly expanded by this Report. Previously, classes were only for concrete types; now, classes can be used for polymorphism over type constructors as well. This feature had been presented in A system of constructor classes a few years prior. The Report includes the following note on terminology:

The term ‘type class’ was used to describe the original Haskell 1.0 type system; ‘constructor class’ was used to describe an extension to the original type classes. There is no longer any reason to use two different terms.

This is the first version of the language that supports newtypes.

April 1997Haskell 1.4Haskell 1.4

March 1997GHC 2.02Release notes for GHC 2.02

The first release of GHC for Haskell 1.4.

April 1997GHC 3.02Release notes for GHC 3.02

April 1997GHC 2.03Release notes for GHC 2.03

September 1997GHC 2.06Release notes for GHC 2.06

October 1997GHC 2.08Release notes for GHC 2.08

November 1997GHC 2.09Release notes for GHC 2.09

December 1997GHC 2.10Release notes for GHC 2.10

December 1998GHC 4.02Release notes for GHC 4.02

This version adds support for scoped type variables.Scoped type variables in GHC 4.04Although scoped type variables were implemented in GHC 4.02, documentation does not appear in the user manual until version 4.04.

  • Introduces pattern type signatures and result type signatures.
  • This feature will be described in Lexically-scoped type variables.
  • Scoped type variables will be significantly modified later in GHC 6.4, and result type signatures will be removed in GHC 6.6.

February 1999Haskell 98

The goals of Haskell 98 are stated in this new ReportHaskell 98 as follows:

Haskell has evolved continuously since its original publication. […] At the 1997 Haskell Workship in Amsterdam, it was decided that a stable variant of Haskell was needed; this stable language is the subject of this Repport, and is called “Haskell 98”.

[…] Haskell will continue to evolve. At the time of writing there are Haskell implementations that support existential types, local universal polymorphism, rank 2 types, multi-parameter type classes, pattern guards, exceptions, concurrency, and more besides. Haskell 98 does not impede these developments. Instead, it provides a stable point of reference, so that those who wish to write text books, or use Haskell for teaching, can do so in the knowledge that Haskell 98 will continue to exist.

Indeed both aspects of this proved true:

  • Haskell 98 remained as the latest language specification until Haskell 2010.
  • Haskell nevertheless continued to evolve.

Minor revisions to Haskell 98 were published a few years later.

New features:

  • The -funbox-strict-fields flag
  • The RULES pragma, used for list fusion
  • Asynchronous exceptions

January 2000GHC 4.06Release notes for GHC 4.06

Here we have the first introduction of the concept of packages,Documentation about packages in GHC 4.08 and the -package and -package-name flags. The standard libraries are included in a package named std. This package will later be renamed to base in GHC 5.04.

Added support for implicit parameters, enabled by the -fglasgow-exts flag. The -fimplicit-params flag would later be added in GHC 6.2, ultimately replaced by -XImplicitParams in GHC 6.8.1.

Added the DEPRECATED pragma.

September 2000Derivable type classesDerivable type classes

This paper presents an approach for introducing generic programming to the Haskell language. Since Haskell’s first specification, it has always been possible to let the compiler automatically generate “obvious” instances — however, this feature known as stock deriving supported only a handful of pre-defined classes. This new idea would allow users who write their own typeclasses to also specify implicit implementations that work for any datatype.

The main contribution generic functions, a new sort of default class method that can describe very generally how to handle sum and product datatypes. The paper’s first example shows how Eq deriving could be defined by writing (==) as a generic function:

class Eq t where
    (==), (/=) :: t -> t -> Bool

    (==) { 1 } Unit Unit = True
    (==) { a + b } (Inl x1) (Inl x2) = True
    (==) { a + b } (Inr y1) (Inr y2) = True
    (==) { a + b } _ _ = False
    (==) { a * b } (x1 :*: y1) (x2 :*: y2) =
        (x1 == x2) && (y1 == y2)

    (/=) x1 x2 = not (x1 == x2)

This feature first appears in GHC 5.00.

Authors: Ralf Hinze and Simon Peyton Jones

February 2001GHC 4.08.2Mailing list: GHC 4.08.2 released

A bugfix release only, with no new features.

Introduced GHCi.

This version of GHC implements the ideas presented in Derivable type classes. It introduces generic classes,Generic classes in GHC 5.00 enabled with the -fgenerics flag (which will correspond to the Generics language extension in GHC 6.6.

This version introduces the -fno-monomorphism-restriction flagGit commit introducing -fno-monomorphism-restriction to disable the monomorphism restriction. This flag has the same effect as the NoMonomorphismRestriction extension which will be introduced in GHC 6.6. Consequently the -fno-monomorphism-restriction flag will be deprecated along with the appearance of -X flags in GHC 6.8.1 in favor of -XNoMonomorphismRestriction.

Other new language features:

  • Parallel list comprehensions
  • Functional dependencies

The concept of packages,Packages in GHC 5.00 previously introduced in GHC 4.08, is expanded upon. This version introduces the ghc-pkg command-line tool for managing the installation of packages.

A bugfix release only, with no new features.

A bugfix release only, with no new features.

Introduced the GHCRTS environment variable.

Added the -fno-code flag, used to only run the typechecker without actually compiling the code.

Allowed defining datatypes with no constructors. This makes it possible to define the Void type.Current API documentation for Void However, Void did not appear in the base library until GHC 7.10.1 much later.

November 2001GHC 5.02.1Mailing list: GHC 5.02.1 released

A bugfix release only, with no new features.

January 2002Lexically-scoped type variablesLexically scoped type variables

This paper compares two alternative designs for scoped type variables and explains the feature as it was implemented in GHC 4.02.

Authors: Simon Peyton Jones and Mark Shields

January 2002GHC 5.02.2Mailing list: GHC 5.02.2 released

Rank-2 types are generalizedArbitrary-rank polymorphism in GHC 5.04 to rank-N types. This feature will become the RankNTypes extension in GHC 6.6.

Generalized newtype deriving is introduced.Generalised derived instances for newtypes in GHC 5.04 This feature will become the GeneralizedNewtypeDeriving extension in GHC 6.6.

This is the first GHC version in which the package name basebase in GHC 5.04 appears. It contains standard library that previously existed in the package called std. The base package does not yet have a version number; package version numbers will not appear until GHC 6.4.

New GHCi commands: :browse, :set args, :set prog, :show bindings, and :show modules.

September 2002GHC 5.04.1Mailing list: GHC 5.04.1 released

December 2002Haskell 98, revisedHaskell 98, revised

This publication is a minor revision of Haskell 98. Simon Peyton Jones writes in the preface:

After a year or two, many typographical errors and infelicities had been spotted. I took on the role of gathering and acting on these corrections, with the following goals:

  • Correct typographical errors.
  • Clarify obscure passages.
  • Resolve ambiguities.
  • With reluctance, make small changes to make the overall language more consistent.

This is the last Report until Haskell 2010.

December 2002GHC 5.04.2Mailing list: GHC 5.04.2 released

This paper introduces the Data class which will appear in GHC 6.0. In the paper, the class is named Term.

Authors: Ralf Lämmel and Simon Peyton Jones

Template Haskell first appears in this release.

  • The Haskell API for this feature, notably including the Q type, is located in a module named Language.Haskell.THSyntaxLanguage.Haskell.THSyntax in GHC 6.0 in the haskell-src package. It will remain here until GHC 6.4.

Introduced recursive do-notation (the mdo keyword)

Introduced the DataAPI documentation for Data in GHC 6.0 class in the Data.Generics module, implementing the ideas presented in the Scrap Your Boilerplate paper. This module will later be moved from base to the syb package, and the Data class will be moved to the Data.Data module, in GHC 6.10.

This release adds support for deriving Typeable instances.

  • Eventually (GHC 7.8, 11 years later) only derived instances will be allowed, but at this point hand-written instance definitions are still permitted.

Added the UNPACK pragma.

Added the -main-is flag, which allows you to use something other than Main.main as a program’s entry point.

Added expression evaluation mode, which evaluates a single expression entered as a command-line argument:

$ ghc -e '2+2'

Added the -fimplicit-params flag to enable implicit parameters. This feature had previously been introduced in GHC 4.08 and had at that time been enabled by -fglasgow-exts. The flag would later be replaced by -XImplicitParams when -X flags were introduced in GHC 6.8.1.

Added the -threaded and -debug link options.

A bugfix release only, with no new features.

January 2005Associated types with classAssociated types with class

This paper introduces the idea of associated types. The beginnings of this feature will appear in GHC 6.8.1.

Author: Simon Peyton Jones

January 2005Composable memory transactionsComposable memory transactions

This paper presents the stm library that first appears in GHC 6.4.

It is named after a previous paper, Software Transactional Memory, which introduced the central idea ten years prior. Haskell’s take on the idea includes some significant new contributions, notably the retry and orElse operations.

Authors: Tim Harris, Simon Marlow, and Simon Peyton Jones

New feature: Generalized algebraic datatypes (GADTs)

This release comes with version 1.0 of the stm library, the first appearance of software transactional memory (STM) as described in Composable memory transactions.

This version expands upon the scoped type variablesScoped type variables in GHC 6.4 feature previously introduced in GHC 4.02.

  • Declaration type signatures that use the forall keyword can now bind type variables over the scope of the corresponding definition.

This is the first version of GHC to include Cabal.Cabal in GHC 6.4

The OPTIONS pragma was renamed to OPTIONS_GHC.

Changes to Template Haskell (first introduced in GHC 6.0):

  • The API moved from the haskell-src package into a new package called template-haskell.
  • The Language.Haskell.THSyntax moduleLanguage.Haskell.TH.Syntax in GHC 6.4 was renamed to Language.Haskell.TH.Syntax.

November 2005Applicative programming with effectsApplicative programming with effects

This paperThe paper was published in the Journal of Functional Programming in January 2008, but we give an earlier date here as it seems to have been circulated much earlier. introduces applicative functors. Its definitions for Applicative and Traversable classes closely resemble what will soon appear in GHC 6.6.

In its discussion of how Applicative differs from Monad, it includes an example of an Either-like type that can be used to sequence the results of multi-step computation and produce a list of all of the errors (not merely the first) if multiple steps fail. We commonly know this type today as Validation.

Authors: Conor McBride and Ross Paterson

Added the GHCi :set command for customizing your GHCi prompt.

July 2006The essence of the iterator patternThe essence of the iterator patternMPC/AMAST 2006 talk schedule

This paperPublished in Journal of Functional Programming in July 2009. elaborates on the utility of the Applicative class (previously introduced by Applicative programming with effects), explaining how applicative traversal in Haskell resembles looping in many imperative languages.

Authors: Jeremy Gibbons and Bruno C. d. S. Oliveira

New features:

  • BangPatterns
  • The :main command in GHCi
  • GADTs can now use record syntax and deriving clauses.

This version support postfix operators.Postfix operators in GHC 6.6 The documentation notes: “Since this extension goes beyond Haskell 98, it should really be enabled by a flag; but in fact it is enabled all the time.” This will be done later when GHC 6.10.1 adds the PostfixOperators language extension.

This version makes some changesScoped type variables in GHC 6.6 to how scoped type variables work.

Introduced the LANGUAGE pragma for enabling language extensions.

  • Prior to this version, the only way to enable language extensions was to use a compiler flag; for example, to enable scoped type variables, you would either invoke the ghc executable with the -fscoped-type-variables flag or add {-# OPTIONS_GHC -fscoped-type-variables #-} to Haskell source file. Now you also have the option of enabling the extension by adding {-# LANGUAGE ScopedTypeVariables #-} to a Haskell source file.Extensions supported by the LANGUAGE pragma in GHC 6.6
  • Complete list of extensions that can be enabled by the LANGUAGE pragma as of this GHC version: Arrows, BangPatterns, ContextStack, CPP, EmptyDataDecls, ExistentialQuantification, ExtensibleRecords, FlexibleContexts, FlexibleInstances, ForeignFunctionInterface, FunctionalDependencies, GeneralizedNewtypeDeriving, Generics, HereDocuments, ImplicitParams, IncoherentInstances, InlinePhase, MultiParamTypeClasses, NamedFieldPuns, NoImplicitPrelude, NoMonomorphismRestriction, OverlappingInstances, ParallelListComp, PatternGuards, PolymorphicComponents, Rank2Types, RankNTypes, RecursiveDo, RestrictedTypeSynonyms, ScopedTypeVariables, TemplateHaskell, TypeSynonymInstances, UndecidableInstances
  • The -X flag still did not exist; this will appear in GHC 6.8.1.

This GHC version corresponds to base version 2.1, which introduced some significant new features.

This is where we first see Applicative functors, as described by Applicative programming with effects, with the addition of three new modules (will later be incorporated into Prelude in GHC 7.10.1):

  • Control.ApplicativeControl.Applicative in GHC 6.6 — Includes the Applicative and Alternative classes, as well as the Const and ZipList newtypes.
  • Data.FoldableData.Foldable in GHC 6.6 — Defines the Foldable class and many handy functions that are still in use today.
  • Data.TraversableData.Traversable in GHC 6.6 — Defines the Traversable class and a few extra functions. This module is quite small and still remains mostly unchanged from its first appearance.

Other new additions to base:

June 2007A History of Haskell: being lazy with classA History of Haskell: being lazy with class

A substantial history of the development of Haskell, written by some of its principal contributors.

Haskell is now more than 15 years old and has been a seedbed for an immense amount of creative energy. We cannot hope to do justice to all of it here, but we take this opportunity to salute all those who have contributed to what has turned out be a wild ride.

Authors: Paul Hudak, John Hughes, Simon Peyton Jones, and Philip Wadler

September 2007Why it’s nice to be quotedWhy it’s nice to be quoted: quasiquoting for Haskell

This paper presents quasi-quotation for expressions and patterns in Haskell. The implementation will appear in GHC 6.10.1.

Author: Geoffrey Mainland

Introduced the -X flag for enabling language extensions.Git commit introducing the -X flag

  • Prior to this version, most of GHC’s extensions to the Haskell language were enabled using the -fglasgow-exts flag, and a handful of extensions had their own separate flags. For example, to enable scoped type variables when invoking ghc at the command line, previously you would have used the -fscoped-type-variables flag; this new version deprecates that flag, and you now use -XScopedTypeVariables instead.
  • The GHC User’s Guide now says “since: 6.8.1” for many language extensions, even for features that were available in earlier versions of GHC, because this was the first version in which the “-X<extension>” flag as introduced. For example,Current documentation for GADTs the documentation lists GADTs as appearing in 6.8.1, even though generalized algebraic datatypesGit commit introducing the GADTs extension have actually been available in GHC since version 6.4.

Record field disambiguationRecord field disambiguation in GHC 6.8.1 first appears in this release.

This GHC version corresponds to base version 3.0.

The TypeFamilies extension first appears in this version, although it is described in the release notes as “incomplete and not a supported feature”. This feature, also known as “associated types”, was previously presented in Associated types with class.

From here on, GHC adheres to the X.Y.Z version numbering policyVersion numbering policy in GHC 6.8.1 that is still in use today.

December 2007GHC 6.8.2Mailing list: GHC 6.8.2 released

Introduced the QuasiQuotes language extension.

The new language extension PostfixOperators is now required to use postfix operators.

  • This feature was previously enabled by default since its introduction in GHC 6.6.

The new language extension ImpredicativeTypes is nowImpredicative polymorphism in GHC 6.8.3Impredicative polymorphism in GHC 6.10.1 required to use impredicative polymorphism.

  • This feature was previously enabled by default when it was introduced in GHC 6.8.1.
  • PackageImports
  • TransformListComp
  • ViewPatterns

This GHC version corresponds to base version

This GHC version corresponds to base version

New compiler flags:

  • -fwarn-dodgy-exports
  • -fwarn-unused-do-bind

This GHC version corresponds to base version

July 2010Haskell 2010Haskell 2010

September 2010A Generic Deriving Mechanism for HaskellA Generic Deriving Mechanism for Haskell

Authors: José Pedro Magalhães, Atze Dijkstra, Johan Jeuring, and Andres Löh

  • Haskell2010
  • Haskell98
  • AlternativeLayoutRule
  • AlternativeLayoutRuleTransitional
  • DatatypeContexts
  • DoAndIfThenElse
  • RebindableSyntax

The QuasiQuotes extension,QuasiQuoter API documentation in GHC 7.0.1 previously introduced in GHC 6.10.1, is expanded to allow quasi-quoters in two additional contexts: types and top-level declarations.

  • DefaultSignatures
  • InterruptibleFFI
  • MonadComprehensions
  • NondecreasingIndentation
  • ParallelArrays
  • RelaxedLayout

Changes to language extension flags:

  • Removed Generics, added DeriveGeneric in its place
  • Removed NewQualifiedOperators
  • Removed PArr

Although GADT syntax had existed since the introduction of generalized algebraic datatypes in version 6.4, this version of GHC introduced the GADTSyntax language extension flag, which makes it possible to enable only the syntactic aspects without the additional changes to the type system that GADTs entail.

This version introduced Safe Haskell.

  • The Safe Haskell feature included three language extensions: Safe, Trustworthy, and SafeImports.
  • The SafeImports extension turned out to be short-lived; it was removed when Safe Haskell was redesigned for GHC 7.4. The redesigned version will be described in the paper entitled Safe Haskell.
  • CApiFFI
  • ConstraintKinds
  • DataKinds
  • PolyKinds
  • TraditionalRecordSyntax

This version includes a redesign of the Safe Haskell feature that was introduced in GHC 7.2.

  • Removed the SafeImports extension and added the Unsafe extension.
  • This is the version of Safe Haskell that is described in the Safe Haskell paper.

September 2012Safe HaskellSafe Haskell

The Safe Haskell feature was added to GHC 7.2 and then modified in GHC 7.4; this paper describes Safe Haskell as it is implemented in GHC 7.4.

Author: Simon Peyton Jones

New GHCi features:

  • The -interactive-print flag can be used to customize how results are printed.
  • Added the :seti command

The -fdefer-type-errors flag can turns compilation errors into runtime errors.

This GHC version corresponds to base version

  • AllowAmbiguousTypes
  • EmptyCase
  • JavaScriptFFI
  • NegativeLiterals
  • NullaryTypeClasses
  • NumDecimals
  • OverloadedLists
  • PatternSynonyms
  • RoleAnnotations

Changes regarding the Typeable class:

  • There is a new language extension,Automatically deriving Typeable instances in GHC 7.8 AutoDeriveTypeable, which instructs the compiler to automatically generate an instance of the Typeable class for every type. This extension flag will quickly become irrelevant in GHC 7.10 when auto-deriving becomes the default behavior.
  • Hand-written Typeable instances are no longer permitted.
  • Typeable can still be derived with the DeriveDataTypeable extension enabled.

Introduced the MINIMAL pragma.

GHCi now disables the monomorphism restriction by default.

This GHC version corresponds to base version

  • New: Data.Bool.bool :: a -> a -> Bool -> a, the catamorphism for Bool

June 2014Safe, zero-cost coercions for HaskellSafe, zero-cost coercions for Haskell

This paper describes the coercion and role-checking features implemented in GHC 7.8.1.

Authors: Joachin Breitner, Richard Eisenberg, Simon Peyton Jones, and Stephanie Weirich

In a wholehearted embrace of applicative functors and related classes, there were significant changes to the base library:

  • Applicative is now included in the Prelude module, and it is nowMonad in GHC 7.10 a superclass of Monad.
  • Foldable and Traversable are now included in the Prelude module.Foldable/Traversable in Prelude Many list functions in Prelude were replaced with more generic Foldable variants. For example, the type of length changed from [a] -> Int to Foldable t => t a -> Int. This change was referred to in discussions as "Foldable/Traversable in Prelude" (abbreviated as "FTP").

This GHC version corresponds to base version

Some other changes to base:

The Typeable class is now derived for all types by default.

  • Deriving declarations for Typeable are still permitted, but they have no effect.Deriving Typeable in GHC 7.10
  • All mention of the AutoDeriveTypeable extension disappears from the GHC User’s Guide.

This GHC version corresponds to base version

  • Some constraints in Control.Monadforever in base-4.9 were generalized from Monad to Applicative, taking advantage of the recent decision to make Applicative a superclass of Monad in GHC 7.10.
  • The Data.List.NonEmpty and Data.Semigroup modules, previously available in a package called semigroups, are now incorporated into the base package. Semigroup will later be made a superclass of Monoid and added to Prelude in GHC 8.4.
  • Added the TypeError classCustom compile-time errors in GHC 8.0 which makes it possible to define custom error messages for when compilation fails due to a missing typeclass instance.
  • DerivingStrategies
  • UnboxedSums

Options added to the GHCi :type command:

This GHC version corresponds to base version

This GHC version corresponds to base version

  • EmptyDataDeriving
  • HexFloatLiterals

This GHC version corresponds to base version

This GHC version corresponds to base version

This paper describes the deriving via language extension, which soon appeared in GHC 8.6.1.

Authors: Baldur Blöndal, Andres Löh, and Ryan Scott

GeneralisedNewtypeDeriving is added as a synonym for GeneralizedNewtypeDeriving. (“Generalized” with a z is the American spelling; “generalised” with an s is the British spelling.)

January 2020GHC 8.8.2GHC blog: GHC 8.8.2 released

February 2020GHC 8.8.3GHC blog: GHC 8.8.3 released

  • UnliftedNewtypes
  • StandaloneKindSignatures

Added the GHCi :instances command, which gives a list of a type’s typeclass instances.

This version of GHC corresponds to base version

A bugfix release only, with no new features.

Join Type Classes for courses and projects to get you started and make you an expert in FP with Haskell.