base
Basic libraries
LTS Haskell 18.14:  4.14.3.0 
Stackage Nightly 20211027:  4.15.0.0 
Latest on Hackage:  4.15.0.0 
base4.15.0.0@sha256:5b769b2e609e714bbfa82701823e9ef0ddec0f1c1898916973be5c9aee9c2225,11783
Module documentation for 4.15.0.0
 Control
 Data
 Data.Bifoldable
 Data.Bifunctor
 Data.Bitraversable
 Data.Bits
 Data.Bool
 Data.Char
 Data.Coerce
 Data.Complex
 Data.Data
 Data.Dynamic
 Data.Either
 Data.Eq
 Data.Fixed
 Data.Foldable
 Data.Function
 Data.Functor
 Data.IORef
 Data.Int
 Data.Ix
 Data.Kind
 Data.List
 Data.Maybe
 Data.Monoid
 Data.Ord
 Data.Proxy
 Data.Ratio
 Data.STRef
 Data.Semigroup
 Data.String
 Data.Traversable
 Data.Tuple
 Data.Type
 Data.Typeable
 Data.Unique
 Data.Version
 Data.Void
 Data.Word
 Debug
 Foreign
 GHC
 GHC.Arr
 GHC.Base
 GHC.ByteOrder
 GHC.Char
 GHC.Clock
 GHC.Conc
 GHC.ConsoleHandler
 GHC.Constants
 GHC.Desugar
 GHC.Enum
 GHC.Environment
 GHC.Err
 GHC.Event
 GHC.Exception
 GHC.ExecutionStack
 GHC.Exts
 GHC.Fingerprint
 GHC.Float
 GHC.Foreign
 GHC.ForeignPtr
 GHC.GHCi
 GHC.Generics
 GHC.IO
 GHC.IOArray
 GHC.IOPort
 GHC.IORef
 GHC.Int
 GHC.Integer
 GHC.Ix
 GHC.List
 GHC.MVar
 GHC.Maybe
 GHC.Natural
 GHC.Num
 GHC.OldList
 GHC.OverloadedLabels
 GHC.Pack
 GHC.Profiling
 GHC.Ptr
 GHC.RTS
 GHC.Read
 GHC.Real
 GHC.Records
 GHC.ResponseFile
 GHC.ST
 GHC.STRef
 GHC.Show
 GHC.Stable
 GHC.StableName
 GHC.Stack
 GHC.StaticPtr
 GHC.Stats
 GHC.Storable
 GHC.TopHandler
 GHC.TypeLits
 GHC.TypeNats
 GHC.Unicode
 GHC.Weak
 GHC.Word
 Numeric
 Prelude
 System
 Text
 Type
 Unsafe
This package contains the Standard Haskell Prelude
and its support libraries,
and a large collection of useful libraries ranging from data
structures to parsing combinators and debugging utilities.
Changes
Changelog for base
package
4.15.0.0 January 2021

Add
Functor
,Applicative
,Monad
,MonadFix
,Foldable
,Traversable
,Eq
,Ord
,Show
,Read
,Eq1
,Ord1
,Show1
,Read1
,Generic
,Generic1
, andData
instances forGHC.Tuple.Solo
. 
openFile
now calls theopen
system call with aninterruptible
FFI call, ensuring that the call can be interrupted withSIGINT
on POSIX systems. 
Add
hGetContents'
,getContents'
, andreadFile'
inSystem.IO
: Strict IO variants ofhGetContents
,getContents
, andreadFile
. 
Add
singleton
function forData.List.NonEmpty
. 
The planned deprecation of
Data.Monoid.First
andData.Monoid.Last
is scrapped due to difficulties with the suggested migration path. 
Data.Semigroup.Option
and the accompanyingoption
function are deprecated and scheduled for removal in 4.16. 
Add
Generic
instances toFingerprint
,GiveGCStats
,GCFlags
,ConcFlags
,DebugFlags
,CCFlags
,DoHeapProfile
,ProfFlags
,DoTrace
,TraceFlags
,TickyFlags
,ParFlags
,RTSFlags
,RTSStats
,GCStats
,ByteOrder
,GeneralCategory
,SrcLoc

Add rules
unpackUtf8
,unpacklistUtf8
andunpackappendUtf8
toGHC.Base
. They correspond to their ascii versions and hopefully make it easier for libraries to handle utf8 encoded strings efficiently. 
An issue with list fusion and
elem
was fixed.elem
applied to known small lists will now compile to a simple case statement more often. 
Add
MonadFix
andMonadZip
instances forComplex

Add
Ix
instances for tuples of size 6 through 15 
Correct
Bounded
instance and removeEnum
andIntegral
instances forData.Ord.Down
. 
Foreign.ForeignPtr.withForeignPtr
is now less aggressively optimised, avoiding the soundness issue reported in #17760 in exchange for a small amount more allocation. If your application regresses significantly and the continuation given towithForeignPtr
will not provably diverge then the previous optimisation behavior can be recovered by instead usingGHC.ForeignPtr.unsafeWithForeignPtr
.
4.14.1.0 Jul 2020

Bundled with GHC 8.10.2

Fix a precision issue in
log1mexp
(#17125)
4.14.0.0 Jan 2020

Bundled with GHC 8.10.1

Add a
TestEquality
instance for theCompose
newtype. 
Data.Ord.Down
now has a field name,getDown

Add
Bits
,Bounded
,Enum
,FiniteBits
,Floating
,Fractional
,Integral
,Ix
,Real
,RealFrac
,RealFloat
andStorable
instances toData.Ord.Down
. 
Fix the
integergmp
variant ofisValidNatural
: Previously it would fail to detect values<= maxBound::Word
that were incorrectly encoded using theNatJ#
constructor. 
The type of
coerce
has been generalized. It is now runtimerepresentation polymorphic:forall {r :: RuntimeRep} (a :: TYPE r) (b :: TYPE r). Coercible a b => a > b
. The type argumentr
is marked asInferred
to prevent it from interfering with visible type application. 
Make
Fixed
andHasResolution
polykinded. 
Add
HasResolution
instances forNat
s. 
Add
Functor
,Applicative
,Monad
,Alternative
,MonadPlus
,Generic
andGeneric1
instances toKleisli

openTempFile
is now fully atomic and threadsafe on Windows. 
Add
isResourceVanishedError
,resourceVanishedErrorType
, andisResourceVanishedErrorType
toSystem.IO.Error
. 
Add newtypes for
CSocklen
(socklen_t
) andCNfds
(nfds_t
) toSystem.Posix.Types
. 
Add
Functor
,Applicative
andMonad
instances to(,,) a b
and(,,,) a b c
. 
Add
resizeSmallMutableArray#
toGHC.Exts
. 
Add a
Data
instance toWrappedArrow
,WrappedMonad
, andZipList
. 
Add
IsList
instance forZipList
.
4.13.0.0 July 2019

Bundled with GHC 8.8.1

The final phase of the
MonadFail
proposal has been implemented:
The
fail
method ofMonad
has been removed in favor of the method of the same name in theMonadFail
class. 
MonadFail(fail)
is now reexported from thePrelude
andControl.Monad
modules.


Fix
Show
instance ofData.Fixed
: Negative numbers are now parenthesized according to their surrounding context. I.e.Data.Fixed.show
produces syntactically correct Haskell for expressions likeJust (1 :: Fixed E2)
. (#16031) 
Support the characters from recent versions of Unicode (up to v. 12) in literals (#5518).

The
StableName
type parameter now has a phantom role instead of a representational one. There is really no reason to care about the type of the underlying object. 
Add
foldMap'
, a strict version offoldMap
, toFoldable
. 
The
shiftL
andshiftR
methods in theBits
instances ofInt
,IntN
,Word
, andWordN
now throw an overflow exception for negative shift values (instead of being undefined behaviour). 
scanr
no longer crashes when passed a fusable, infinite list. (#16943)
4.12.0.0 21 September 2018

Bundled with GHC 8.6.1

The STM invariantchecking mechanism (
always
andalwaysSucceeds
), which was deprecated in GHC 8.4, has been removed (as proposed in https://github.com/ghcproposals/ghcproposals/blob/master/proposals/0011deprecatestminvariants.rst). This is a bit earlier than proposed in the deprecation pragma included in GHC 8.4, but due to community feedback we decided to move ahead with the early removal.Existing users are encouraged to encapsulate their STM operations in safe abstractions which can perform the invariant checking without help from the runtime system.

Add a new module
GHC.ResponseFile
(previously defined in thehaddock
package). (#13896) 
Move the module
Data.Functor.Contravariant
from thecontravariant
package tobase
. 
($!)
is now representationpolymorphic like($)
. 
Add
Applicative
(forK1
),Semigroup
andMonoid
instances inGHC.Generics
. (#14849) 
asinh
forFloat
andDouble
is now numerically stable in the face of nonsmall negative arguments and enormous arguments of either sign. (#14927) 
Numeric.showEFloat (Just 0)
now respects the user’s requested precision. (#15115) 
Data.Monoid.Alt
now hasFoldable
andTraversable
instances. (#15099) 
Data.Monoid.Ap
has been introduced 
Control.Exception.throw
is now levity polymorphic. (#15180) 
Data.Ord.Down
now has a number of new instances. These include:MonadFix
,MonadZip
,Data
,Foldable
,Traversable
,Eq1
,Ord1
,Read1
,Show1
,Generic
,Generic1
. (#15098)
4.11.1.0 19 April 2018

Bundled with GHC 8.4.2

Add the
readFieldHash
function toGHC.Read
which behaves likereadField
, but for a field that ends with a#
symbol (#14918).
4.11.0.0 8 March 2018

Bundled with GHC 8.4.1

System.IO.openTempFile
is now threadsafe on Windows. 
Deprecated
GHC.Stats.GCStats
interface has been removed. 
Add
showHFloat
toNumeric

Add
Div
,Mod
, andLog2
functions on typelevel naturals inGHC.TypeLits
. 
Add
Alternative
instance forZipList
(#13520) 
Add instances
Num
,Functor
,Applicative
,Monad
,Semigroup
andMonoid
forData.Ord.Down
(#13097). 
Add
Semigroup
instance forEventLifetime
. 
Make
Semigroup
a superclass ofMonoid
; exportSemigroup((<>))
fromPrelude
; removeMonoid
reexport fromData.Semigroup
(#14191). 
Generalise
instance Monoid a => Monoid (Maybe a)
toinstance Semigroup a => Monoid (Maybe a)
. 
Add
infixl 9 !!
declaration forData.List.NonEmpty.!!

Add
<&>
operator toData.Functor
(#14029) 
Remove the deprecated
Typeable{1..7}
type synonyms (#14047) 
Make
Data.Type.Equality.==
a closed type family. It now works for all kinds out of the box. Any modules that previously declared instances of this family will need to remove them. Whereas the previous definition was somewhat ad hoc, the behavior is now completely uniform. As a result, some applications that used to reduce no longer do, and conversely. Most notably,(==)
no longer treats the*
,j > k
, or()
kinds specially; equality is tested structurally in all cases. 
Add instances
Semigroup
andMonoid
forControl.Monad.ST
(#14107). 
The
Read
instances forProxy
,Coercion
,(:~:)
,(:~~:)
, andU1
now ignore the parsing precedence. The effect of this is thatread
will be able to successfully parse more strings containing"Proxy"
et al. without surrounding parentheses (e.g.,"Thing Proxy"
) (#12874). 
Add
iterate'
, a strict version ofiterate
, toData.List
andData.OldList
(#3474) 
Add
Data
instances forIntPtr
andWordPtr
(#13115) 
Add missing
MonadFail
instance forControl.Monad.Strict.ST.ST

Make
zipWith
andzipWith3
inlinable (#14224) 
Type.Reflection.App
now matches on function types (fixes #14236) 
Type.Reflection.withTypeable
is now polymorphic in theRuntimeRep
of its result. 
Add
installSEHHandlers
toMiscFlags
inGHC.RTS.Flags
to determine if exception handling is enabled. 
The deprecated functions
isEmptyChan
andunGetChan
inControl.Concurrent.Chan
have been removed (#13561). 
Add
generateCrashDumpFile
toMiscFlags
inGHC.RTS.Flags
to determine if a core dump will be generated on crashes. 
Add
generateStackTrace
toMiscFlags
inGHC.RTS.Flags
to determine if stack traces will be generated on unhandled exceptions by the RTS. 
getExecutablePath
now resolves symlinks on Windows (#14483) 
Deprecated STM invariant checking primitives (
checkInv
,always
, andalwaysSucceeds
) inGHC.Conc.Sync
(#14324). 
Add a
FixIOException
data type toControl.Exception.Base
, and changefixIO
to throw that instead of aBlockedIndefinitelyOnMVar
exception (#14356).
4.10.1.0 November 2017

Bundled with GHC 8.2.2

The file locking primitives provided by
GHC.IO.Handle
now use Linux open file descriptor locking if available. 
Fixed bottoming definition of
clearBit
forNatural
4.10.0.0 July 2017

Bundled with GHC 8.2.1

Data.Type.Bool.Not
given a type family dependency (#12057). 
Foreign.Ptr
now exports the constructors forIntPtr
andWordPtr
(#11983) 
Generic1
, as well as the associated datatypes and typeclasses inGHC.Generics
, are now polykinded (#10604) 
New modules
Data.Bifoldableand
Data.Bitraversable(previously defined in the
bifunctors` package) (#10448) 
Data.Either
now providesfromLeft
andfromRight
(#12402) 
Data.Type.Coercion
now providesgcoerceWith
(#12493) 
New methods
liftReadList(2)
andliftReadListPrec(2)
in theRead1
/Read2
classes that are defined in terms ofReadPrec
instead ofReadS
, as well as related combinators, have been added toData.Functor.Classes
(#12358) 
Add
Semigroup
instance forIO
, as well as forEvent
andLifetime
fromGHC.Event
(#12464) 
Add
Data
instance forConst
(#12438) 
Added
Eq1
,Ord1
,Read1
andShow1
instances forNonEmpty
. 
Add wrappers for
blksize_t
,blkcnt_t
,clockid_t
,fsblkcnt_t
,fsfilcnt_t
,id_t
,key_t
, andtimer_t
to System.Posix.Types (#12795) 
Add
CBool
, a wrapper around C’sbool
type, toForeign.C.Types
(#13136) 
Raw buffer operations in
GHC.IO.FD
are now strict in the buffer, offset, and length operations (#9696) 
Add
plusForeignPtr
toForeign.ForeignPtr
. 
Add
type family AppendSymbol (m :: Symbol) (n :: Symbol) :: Symbol
toGHC.TypeLits
(#12162) 
Add
GHC.TypeNats
module withNatural
basedKnownNat
. TheNat
operations inGHC.TypeLits
are a thin compatibility layer on top. Note: theKnownNat
evidence is changed from anInteger
to aNatural
. 
The type of
asProxyTypeOf
inData.Proxy
has been generalized (#12805) 
liftA2
is now a method of theApplicative
class.liftA2
and<*>
each have a default implementation based on the other. Various library functions have been updated to useliftA2
where it might offer some benefit.liftA2
is not yet in thePrelude
, and must currently be imported fromControl.Applicative
. It is likely to be added to thePrelude
in the future. (#13191) 
A new module,
Type.Reflection
, exposing GHC’s new typeindexed type representation mechanism is now provided. 
Data.Dynamic
now exports theDyn
data constructor, enabled by the new typeindexed type representation mechanism. 
Data.Type.Equality
now provides a kind heterogeneous type equality evidence type,(:~~:)
. 
The
CostCentresXML
constructor ofGHC.RTS.Flags.DoCostCentres
has been replaced byCostCentresJSON
due to the new JSON export format supported by the cost centre profiler. 
The
ErrorCall
pattern synonym has been given aCOMPLETE
pragma so that functions which solely match againErrorCall
do not produce nonexhaustive patternmatch warnings (#8779) 
Change the implementations of
maximumBy
andminimumBy
fromData.Foldable
to usefoldl1
instead offoldr1
. This makes them run in constant space when applied to lists. (#10830) 
mkFunTy
,mkAppTy
, andmkTyConApp
fromData.Typeable
no longer exist. This functionality is superceded by the interfaces provided byType.Reflection
. 
mkTyCon3
is no longer exported byData.Typeable
. This function is replaced byType.Reflection.Unsafe.mkTyCon
. 
Data.List.NonEmpty.unfold
has been deprecated in favor ofunfoldr
, which is functionally equivalent.
4.9.0.0 May 2016

Bundled with GHC 8.0

error
andundefined
now print a partial stacktrace alongside the error message. 
New
errorWithoutStackTrace
function throws an error without printing the stack trace. 
The restore operation provided by
mask
anduninterruptibleMask
now restores the previous masking state whatever the current masking state is. 
New
GHC.Generics.packageName
operation 
Redesigned
GHC.Stack.CallStack
data type. As a result,CallStack
’sShow
instance produces different output, andCallStack
no longer has anEq
instance. 
New
GHC.Generics.packageName
operation 
New
GHC.Stack.Types
module now contains the definition ofCallStack
andSrcLoc

New
GHC.Stack.Types.emptyCallStack
function builds an emptyCallStack

New
GHC.Stack.Types.freezeCallStack
function freezes aCallStack
preventing futurepushCallStack
operations from having any effect 
New
GHC.Stack.Types.pushCallStack
function pushes a callsite onto aCallStack

New
GHC.Stack.Types.fromCallSiteList
function creates aCallStack
from a list of callsites (i.e.,[(String, SrcLoc)]
) 
GHC.SrcLoc
has been removed 
GHC.Stack.showCallStack
andGHC.SrcLoc.showSrcLoc
are now calledGHC.Stack.prettyCallStack
andGHC.Stack.prettySrcLoc
respectively 
add
Data.List.NonEmpty
andData.Semigroup
(to become superclass ofMonoid
in the future). These modules were provided by thesemigroups
package previously. (#10365) 
Add
selSourceUnpackedness
,selSourceStrictness
, andselDecidedStrictness
, three functions which look up strictness information of a field in a data constructor, to theSelector
type class inGHC.Generics
(#10716) 
Add
URec
,UAddr
,UChar
,UDouble
,UFloat
,UInt
, andUWord
toGHC.Generics
as part of making GHC generics capable of handling unlifted types (#10868) 
The
Eq
,Ord
,Read
, andShow
instances forU1
now use lazier patternmatching 
Keep
shift{L,R}
onInteger
with negative shiftarguments from segfaulting (#10571) 
Add
forkOSWithUnmask
toControl.Concurrent
, which is likeforkIOWithUnmask
, but the child is run in a bound thread. 
The
MINIMAL
definition ofArrow
is nowarr AND (first OR (***))
. 
The
MINIMAL
definition ofArrowChoice
is nowleft OR (+++)
. 
Exported
GiveGCStats
,DoCostCentres
,DoHeapProfile
,DoTrace
,RtsTime
, andRtsNat
fromGHC.RTS.Flags

New function
GHC.IO.interruptible
used to correctly implementControl.Exception.allowInterrupt
(#9516) 
Made
PatternMatchFail
,RecSelError
,RecConError
,RecUpdError
,NoMethodError
, andAssertionFailed
newtypes (#10738) 
New module
Control.Monad.IO.Class
(previously provided bytransformers
package). (#10773) 
New modules
Data.Functor.Classes
,Data.Functor.Compose
,Data.Functor.Product
, andData.Functor.Sum
(previously provided bytransformers
package). (#11135) 
New instances for
Proxy
:Eq1
,Ord1
,Show1
,Read1
. All of the classes are fromData.Functor.Classes
(#11756). 
New module
Control.Monad.Fail
providing newMonadFail(fail)
class (#10751) 
Add
GHC.TypeLits.TypeError
andErrorMessage
to allow users to define custom compiletime error messages. 
Redesign
GHC.Generics
to use typelevel literals to represent the metadata of generic representation types (#9766) 
The
IsString
instance for[Char]
has been modified to eliminate ambiguity arising from overloaded strings and functions like(++)
. 
Move
Const
fromControl.Applicative
to its own module inData.Functor.Const
. (#11135) 
Reexport
Const
fromControl.Applicative
for backwards compatibility. 
Expand
Floating
class to include operations that allow for better precision:log1p
,expm1
,log1pexp
andlog1mexp
. These are not available fromPrelude
, but the full class is exported fromNumeric
. 
New
Control.Exception.TypeError
datatype, which is thrown when an expression fails to typecheck when run usingfdefertypeerrors
(#10284) 
The
bitSize
method ofData.Bits.Bits
now has a (partial!) default implementation based onbitSizeMaybe
. (#12970)
New instances

Alt
,Dual
,First
,Last
,Product
, andSum
now haveData
,MonadZip
, andMonadFix
instances 
The datatypes in
GHC.Generics
now haveEnum
,Bounded
,Ix
,Functor
,Applicative
,Monad
,MonadFix
,MonadPlus
,MonadZip
,Foldable
,Foldable
,Traversable
,Generic1
, andData
instances as appropriate. 
Maybe
now has aMonadZip
instance 
All
andAny
now haveData
instances 
Dual
,First
,Last
,Product
, andSum
now haveFoldable
andTraversable
instances 
Dual
,Product
, andSum
now haveFunctor
,Applicative
, andMonad
instances 
(,) a
now has aMonad
instance 
ZipList
now hasFoldable
andTraversable
instances 
Identity
now hasSemigroup
andMonoid
instances 
Identity
andConst
now haveBits
,Bounded
,Enum
,FiniteBits
,Floating
,Fractional
,Integral
,IsString
,Ix
,Num
,Real
,RealFloat
,RealFrac
andStorable
instances. (#11210, #11790) 
()
now has aStorable
instance 
Complex
now hasGeneric
,Generic1
,Functor
,Foldable
,Traversable
,Applicative
, andMonad
instances 
System.Exit.ExitCode
now has aGeneric
instance 
Data.Version.Version
now has aGeneric
instance 
IO
now has aMonoid
instance 
Add
MonadPlus IO
andAlternative IO
instances (previously orphans intransformers
) (#10755) 
CallStack
now has anIsList
instance 
The field
spInfoName
ofGHC.StaticPtr.StaticPtrInfo
has been removed. The value is no longer available when constructing theStaticPtr
. 
VecElem
andVecCount
now haveEnum
andBounded
instances.
Generalizations

Generalize
Debug.Trace.{traceM, traceShowM}
fromMonad
toApplicative
(#10023) 
Redundant typeclass constraints have been removed:
Data.Ratio.{denominator,numerator}
have noIntegral
constraint anymore TODO

Generalise
forever
fromMonad
toApplicative

Generalize
filterM
,mapAndUnzipM
,zipWithM
,zipWithM_
,replicateM
,replicateM_
fromMonad
toApplicative
(#10168) 
The
Generic
instance forProxy
is now polykinded (#10775) 
Enable
PolyKinds
in theData.Functor.Const
module to giveConst
the kind* > k > *
. (#10039)
4.8.2.0 Oct 2015

Bundled with GHC 7.10.3

The restore operation provided by
mask
anduninterruptibleMask
now restores the previous masking state whatever the current masking state is. 
Exported
GiveGCStats
,DoCostCentres
,DoHeapProfile
,DoTrace
,RtsTime
, andRtsNat
fromGHC.RTS.Flags
4.8.1.0 Jul 2015

Bundled with GHC 7.10.2

Lifetime
is now exported fromGHC.Event

Implicitparameter based source location support exposed in
GHC.SrcLoc
andGHC.Stack
. See GHC User’s Manual for more information.
4.8.0.0 Mar 2015

Bundled with GHC 7.10.1

Make
Applicative
a superclass ofMonad

Add reverse application operator
Data.Function.(&)

Add
Data.List.sortOn
sorting function 
Add
System.Exit.die

Deprecate
versionTags
field ofData.Version.Version
. AddmakeVersion :: [Int] > Version
constructor function to aid migration to a futureversionTags
lessVersion
. 
Add
IsList Version
instance 
Weaken RealFloat constraints on some
Data.Complex
functions 
Add
Control.Monad.(<$!>)
as a strict version of(<$>)

The
Data.Monoid
module now has thePolyKinds
extension enabled, so that theMonoid
instance forProxy
are polykinded likeProxy
itself is. 
Make
abs
andsignum
handle (0.0) correctly per IEEE754. 
Reexport
Data.Word.Word
fromPrelude

Add
countLeadingZeros
andcountTrailingZeros
methods toData.Bits.FiniteBits
class 
Add
Data.List.uncons
list destructor (#9550) 
Export
Monoid(..)
fromPrelude

Export
Foldable(..)
fromPrelude
(hidingfold
,foldl'
,foldr'
, andtoList
) 
Export
Traversable(..)
fromPrelude

Set fixity for
Data.Foldable.{elem,notElem}
to match the conventional one set forData.List.{elem,notElem}
(#9610) 
Turn
toList
,elem
,sum
,product
,maximum
, andminimum
intoFoldable
methods (#9621) 
Replace the
Data.List
exported functionsall, and, any, concat, concatMap, elem, find, product, sum, mapAccumL, mapAccumR
by reexports of their generalised
Data.Foldable
/Data.Traversable
counterparts. In other words, unqualified imports ofData.List
andData.Foldable
/Data.Traversable
no longer lead to conflicting definitions. (#9586) 
New (unofficial) module
GHC.OldList
containing only listspecialised versions of the functions fromData.List
(in other words,GHC.OldList
corresponds tobase4.7.0.2
’sData.List
) 
Replace the
Control.Monad
exported functionssequence_, msum, mapM_, forM_, forM, mapM, sequence
by reexports of their generalised
Data.Foldable
/Data.Traversable
counterparts. In other words, unqualified imports ofControl.Monad
andData.Foldable
/Data.Traversable
no longer lead to conflicting definitions. (#9586) 
Generalise
Control.Monad.{when,unless,guard}
fromMonad
toApplicative
and fromMonadPlus
toAlternative
respectively. 
Generalise
Control.Monad.{foldM,foldM_}
toFoldable

scanr
,mapAccumL
andfilterM
now take part in list fusion (#9355, #9502, #9546) 
Remove deprecated
Data.OldTypeable
(#9639) 
New module
Data.Bifunctor
providing theBifunctor(bimap,first,second)
class (previously defined inbifunctors
package) (#9682) 
New module
Data.Void
providing the canonical uninhabited typeVoid
(previously defined invoid
package) (#9814) 
Update Unicode class definitions to Unicode version 7.0

Add
Alt
, anAlternative
wrapper, toData.Monoid
. (#9759) 
Add
isSubsequenceOf
toData.List
(#9767) 
The arguments to
==
andeq
inData.List.nub
andData.List.nubBy
are swapped, such thatData.List.nubBy (<) [1,2]
now returns[1]
instead of[1,2]
(#2528, #3280, #7913) 
New module
Data.Functor.Identity
(previously provided bytransformers
package). (#9664) 
Add
scanl'
, a strictly accumulating version ofscanl
, toData.List
andData.OldList
. (#9368) 
Add
fillBytes
toForeign.Marshal.Utils
. 
Add new
displayException
method toException
typeclass. (#9822) 
Add
Data.Bits.toIntegralSized
, a sizechecked version offromIntegral
. (#9816) 
New module
Numeric.Natural
providing newNatural
type representing nonnegative arbitraryprecision integers. TheGHC.Natural
module exposes additional GHCspecific primitives. (#9818) 
Add
(Storable a, Integeral a) => Storable (Ratio a)
instance (#9826) 
Add
Storable a => Storable (Complex a)
instance (#9826) 
New module
GHC.RTS.Flags
that provides accessors to runtime flags. 
Expose functions for perthread allocation counters and limits in
GHC.Conc
disableAllocationLimit :: IO () enableAllocationLimit :: IO () getAllocationCounter :: IO Int64 setAllocationCounter :: Int64 > IO ()
together with a new exception
AllocationLimitExceeded
. 
Make
read . show = id
forData.Fixed
(#9240) 
Add
calloc
andcallocBytes
toForeign.Marshal.Alloc
. (#9859) 
Add
callocArray
andcallocArray0
toForeign.Marshal.Array
. (#9859) 
Restore invariant in
Data (Ratio a)
instance (#10011) 
Add/expose
rnfTypeRep
,rnfTyCon
,typeRepFingerprint
, andtyConFingerprint
helpers toData.Typeable
. 
Define proper
MINIMAL
pragma forclass Ix
. (#10142)
4.7.0.2 Dec 2014

Bundled with GHC 7.8.4

Fix performance bug in
Data.List.inits
(#9345) 
Fix handling of null bytes in
Debug.Trace.trace
(#9395)
4.7.0.1 Jul 2014

Bundled with GHC 7.8.3

Unhide
Foreign.ForeignPtr
in Haddock (#8475) 
Fix recomputation of
TypeRep
inTypeable
typeapplication instance (#9203) 
Fix regression in Data.Fixed Read instance (#9231)

Fix
fdReady
to honorFD_SETSIZE
(#9168)
4.7.0.0 Apr 2014

Bundled with GHC 7.8.1

Add
/Since: 4.[4567].0.0/
Haddock annotations to entities denoting the package version, when the given entity was introduced (or its type signature changed in a noncompatible way) 
The
Control.Category
module now has thePolyKinds
extension enabled, meaning that instances ofCategory
no longer need be of kind* > * > *
. 
There are now
Foldable
andTraversable
instances forEither a
,Const r
, and(,) a
. 
There are now
Show
,Read
,Eq
,Ord
,Monoid
,Generic
, andGeneric1
instances forConst
. 
There is now a
Data
instance forData.Version
. 
A new
Data.Bits.FiniteBits
class has been added to represent types with fixed bitcount. The existingBits
class is extended with abitSizeMaybe
method to replace the now obsoletebitsize
method. 
Data.Bits.Bits
gained a newzeroBits
method which completes theBits
API with a direct way to introduce a value with all bits cleared. 
There are now
Bits
andFiniteBits
instances forBool
. 
There are now
Eq
,Ord
,Show
,Read
,Generic
. andGeneric1
instances forZipList
. 
There are now
Eq
,Ord
,Show
andRead
instances forDown
. 
There are now
Eq
,Ord
,Show
,Read
andGeneric
instances for types in GHC.Generics (U1
,Par1
,Rec1
,K1
,M1
,(:+:)
,(:*:)
,(:.:)
). 
Data.Monoid
: There are nowGeneric
instances forDual
,Endo
,All
,Any
,Sum
,Product
,First
, andLast
; as well asGeneric1
instances forDual
,Sum
,Product
,First
, andLast
. 
The
Data.Monoid.{Product,Sum}
newtype wrappers now haveNum
instances. 
There are now
Functor
instances forSystem.Console.GetOpt
’sArgOrder
,OptDescr
, andArgDescr
. 
A zerowidth unboxed polykinded
Proxy#
was added toGHC.Prim
. It can be used to make it so that there is no the operational overhead for passing around proxy arguments to model type application. 
New
Data.Proxy
module providing a concrete, polykinded proxy type. 
New
Data.Coerce
module which exports the newCoercible
class together with thecoerce
primitive which provide safe coercion (wrt role checking) between types with same representation. 
Control.Concurrent.MVar
has a new implementation ofreadMVar
, which fixes a longstanding bug wherereadMVar
is only atomic if there are no other threads runningputMVar
.readMVar
now is atomic, and is guaranteed to return the value from the firstputMVar
. There is also a newtryReadMVar
which is a nonblocking version. 
New
Control.Concurrent.MVar.withMVarMasked
which executesIO
action with asynchronous exceptions masked in the same style as the existingmodifyMVarMasked
andmodifyMVarMasked_
. 
New
threadWait{Read,Write}STM :: Fd > IO (STM (), IO ())
functions added toControl.Concurrent
for waiting on FD readiness with STM actions. 
Expose
Data.Fixed.Fixed
’s constructor. 
There are now byte endianswapping primitives
byteSwap{16,32,64}
available inData.Word
, which use optimized machine instructions when available. 
Data.Bool
now exportsbool :: a > a > Bool > a
, analogously tomaybe
andeither
in their respective modules. 
Data.Either
now exportsisLeft, isRight :: Either a b > Bool
. 
Debug.Trace
now exportstraceId
,traceShowId
,traceM
, andtraceShowM
. 
Data.Functor
now exports($>)
andvoid
. 
Rewrote portions of
Text.Printf
, and made changes toNumeric
(addedNumeric.showFFloatAlt
andNumeric.showGFloatAlt
) andGHC.Float
(addedformatRealFloatAlt
) to support it. The rewritten version is extensible to user types, adds a “generic” format specifier “%v
”, extends theprintf
spec to support much of C’sprintf(3)
functionality, and fixes the spurious warnings about usingText.Printf.printf
at(IO a)
while ignoring the return value. These changes were contributed by Bart Massey. 
The minimal complete definitions for all typeclasses with cyclic default implementations have been explicitly annotated with the new
{# MINIMAL #}
pragma. 
Control.Applicative.WrappedMonad
, which can be used to convert aMonad
to anApplicative
, has now aMonad m => Monad (WrappedMonad m)
instance. 
There is now a
Generic
and aGeneric1
instance forWrappedMonad
andWrappedArrow
. 
Handle
ExitFailure (sig)
on Unix by killing process with signalsig
. 
New module
Data.Type.Bool
providing operations on typelevel booleans. 
Expose
System.Mem.performMinorGC
for triggering minor GCs. 
New
System.Environment.{set,unset}Env
for manipulating environment variables. 
Add
Typeable
instance for(>)
andRealWorld
. 
Declare CPP header
<Typeable.h>
officially obsolete as GHC 7.8+ does not support handwrittenTypeable
instances anymore. 
Remove (unmaintained) Hugs98 and NHC98 specific code.

Optimize
System.Timeout.timeout
for the threaded RTS. 
Remove deprecated functions
unsafeInterleaveST
,unsafeIOToST
, andunsafeSTToIO
fromControl.Monad.ST
. 
Add a new superclass
SomeAsyncException
for all asynchronous exceptions and makes the existingAsyncException
andTimeout
exception children ofSomeAsyncException
in the hierarchy. 
Remove deprecated functions
blocked
,unblock
, andblock
fromControl.Exception
. 
Remove deprecated function
forkIOUnmasked
fromControl.Concurrent
. 
Remove deprecated function
unsafePerformIO
export fromForeign
(still available viaSystem.IO.Unsafe.unsafePerformIO
). 
Various fixes and other improvements (see Git history for full details).