GHC 6.6

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,Commit introducing ApplicativeCommit introducing Alternative 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:

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