changelog.md 15.8 KB
Newer Older
1 2
# Changelog for [`base` package](http://hackage.haskell.org/package/base)

3 4 5
## 4.9.0.0  *TBA*

  * Bundled with GHC 8.0
Austin Seipp's avatar
Austin Seipp committed
6

7 8 9
  * The restore operation provided by `mask` and `uninterruptibleMask` now
    restores the previous masking state whatever the current masking state is.

10 11 12 13 14 15 16 17 18 19 20 21 22
  * `Alt`, `Dual`, `First`, `Last`, `Product`, and `Sum` now have `Data`,
    `MonadZip`, and `MonadFix` instances

  * `Maybe` now has a `MonadZip` instance

  * `All` and `Any` now have `Data` instances

  * `Dual`, `First`, `Last`, `Product`, and `Sum` now have `Foldable` and
    `Traversable` instances

  * `Dual`, `Product`, and `Sum` now have `Functor`, `Applicative`, and
    `Monad` instances

23 24
  * `(,) a` now has a `Monad` instance

Fumiaki Kinoshita's avatar
Fumiaki Kinoshita committed
25 26 27 28 29 30
  * `ZipList` now has `Foldable` and `Traversable` instances

  * `Identity` now has a `Monoid` instance

  * `()` now has a `Storable` instance

31 32 33 34 35 36
  * Redundant typeclass constraints have been removed:
     - `Data.Ratio.{denominator,numerator}` have no `Integral` constraint anymore
     - **TODO**

  * New `GHC.Generics.packageName` operation

37
  * New `GHC.Stack.CallStack` data type
38

Fumiaki Kinoshita's avatar
Fumiaki Kinoshita committed
39 40
  * `Complex` now has `Generic`, `Generic1`, `Functor`, `Foldable`, `Traversable`,
    `Applicative`, and `Monad` instances
41

42 43
  * `System.Exit.ExitCode` now has a `Generic` instance

44 45
  * `Data.Version.Version` now has a `Generic` instance

Gabriel439's avatar
Gabriel439 committed
46 47
  * `IO` now has a `Monoid` instance

48 49 50
  * Generalize `Debug.Trace.{traceM, traceShowM}` from `Monad` to `Applicative`
    (#10023)

51 52
  * Generalise `forever` from `Monad` to `Applicative`

53 54 55
  * Generalize `filterM`, `mapAndUnzipM`, `zipWithM`, `zipWithM_`, `replicateM`,
    `replicateM` from `Monad` to `Applicative` (#10168)

56 57 58
  * Exported `GiveGCStats`, `DoCostCentres`, `DoHeapProfile`, `DoTrace`,
    `RtsTime`, and `RtsNat` from `GHC.RTS.Flags`

59 60 61
  * New function `GHC.IO.interruptible` used to correctly implement
    `Control.Exception.allowInterrupt` (#9516)

62 63 64
  * Made `PatternMatchFail`, `RecSelError`, `RecConError`, `RecUpdError`,
    `NoMethodError`, and `AssertionFailed` newtypes (#10738)

65 66 67
  * New module `Control.Monad.IO.Class` (previously provided by `transformers`
    package). (#10773)

68 69 70 71
  * New modules `Data.Functor.Classes`, `Data.Functor.Compose`,
    `Data.Functor.Product`, and `Data.Functor.Sum` (previously provided by
    `transformers` package). (#11135)

72 73 74
  * New module `Control.Monad.Fail` providing new `MonadFail(fail)`
    class (#10751)

75 76
  * The `Generic` instance for `Proxy` is now poly-kinded (#10775)

77 78 79 80
  * add `Data.List.NonEmpty` and `Data.Semigroup` (to become
    super-class of `Monoid` in the future). These modules were
    provided by the `semigroups` package previously. (#10365)

81 82 83 84
  * Add `URec`, `UAddr`, `UChar`, `UDouble`, `UFloat`, `UInt`, and `UWord` to
    `GHC.Generics` as part of making GHC generics capable of handling
    unlifted types (#10868)

85
  * Keep `shift{L,R}` on `Integer` with negative shift-arguments from
joeyadams's avatar
joeyadams committed
86 87 88 89 90
    segfaulting (#10571)

  * Add `forkOSWithUnmask` to `Control.Concurrent`, which is like
    `forkIOWithUnmask`, but the child is run in a bound thread.

91 92 93
  * The `MINIMAL` definition of `Arrow` is now `arr AND (first OR (***))`.

  * The `MINIMAL` definition of `ArrowChoice` is now `left OR (+++)`.
94

95 96 97
  * Add `MonadPlus IO` and `Alternative IO` instances
    (previously orphans in `transformers`) (#10755)

Ben Gamari's avatar
Ben Gamari committed
98 99 100
  * Add `GHC.TypeLits.TypeError` and `ErrorMessage` to allow users
    to define custom compile-time error messages.

101 102 103
  * Redesign `GHC.Generics` to use type-level literals to represent the
    metadata of generic representation types (#9766)

104 105 106
  * The `IsString` instance for `[Char]` has been modified to eliminate
    ambiguity arising from overloaded strings and functions like `(++)`.

107 108 109 110 111 112 113 114
  * Move `Const` from `Control.Applicative` to its own module in
   `Data.Functor.Const`. (#11135)

  * Enable `PolyKinds` in the `Data.Functor.Const` module to give `Const`
    the kind `* -> k -> *`. (#10039)

  * Re-export `Const` from `Control.Applicative` for backwards compatibility.

dolio's avatar
dolio committed
115 116 117
  * Expand `Floating` class to include operations that allow for better
    precision: `log1p`, `expm1`, `log1pexp` and `log1mexp`. These are not
    available from `Prelude`, but the full class is exported from `Numeric`.
118

119 120 121 122 123 124 125 126 127 128
## 4.8.2.0  *Oct 2015*

  * Bundled with GHC 7.10.3

  * The restore operation provided by `mask` and `uninterruptibleMask` now
    restores the previous masking state whatever the current masking state is.

  * Exported `GiveGCStats`, `DoCostCentres`, `DoHeapProfile`, `DoTrace`,
    `RtsTime`, and `RtsNat` from `GHC.RTS.Flags`

129
## 4.8.1.0  *Jul 2015*
130 131 132

  * Bundled with GHC 7.10.2

133 134
  * `Lifetime` is now exported from `GHC.Event`

135
  * Implicit-parameter based source location support exposed in `GHC.SrcLoc` and `GHC.Stack`.
136 137
    See GHC User's Manual for more information.

138
## 4.8.0.0  *Mar 2015*
139 140 141

  * Bundled with GHC 7.10.1

142 143
  * Make `Applicative` a superclass of `Monad`

144 145
  * Add reverse application operator `Data.Function.(&)`

146 147
  * Add `Data.List.sortOn` sorting function

Simon Hengel's avatar
Simon Hengel committed
148 149
  * Add `System.Exit.die`

150 151 152 153 154 155
  * Deprecate `versionTags` field of `Data.Version.Version`.
    Add `makeVersion :: [Int] -> Version` constructor function to aid
    migration to a future `versionTags`-less `Version`.

  * Add `IsList Version` instance

156 157
  * Weaken RealFloat constraints on some `Data.Complex` functions

158 159
  * Add `Control.Monad.(<$!>)` as a strict version of `(<$>)`

160 161 162 163
  * The `Data.Monoid` module now has the `PolyKinds` extension
    enabled, so that the `Monoid` instance for `Proxy` are polykinded
    like `Proxy` itself is.

164
  * Make `abs` and `signum` handle (-0.0) correctly per IEEE-754.
165

166 167
  * Re-export `Data.Word.Word` from `Prelude`

168 169 170
  * Add `countLeadingZeros` and `countTrailingZeros` methods to
    `Data.Bits.FiniteBits` class

171 172
  * Add `Data.List.uncons` list destructor (#9550)

173 174 175 176 177 178 179
  * Export `Monoid(..)` from `Prelude`

  * Export `Foldable(..)` from `Prelude`
    (hiding `fold`, `foldl'`, `foldr'`, and `toList`)

  * Export `Traversable(..)` from `Prelude`

180 181 182
  * Set fixity for `Data.Foldable.{elem,notElem}` to match the
    conventional one set for `Data.List.{elem,notElem}` (#9610)

183 184 185
  * Turn `toList`, `elem`, `sum`, `product`, `maximum`, and `minimum`
    into `Foldable` methods (#9621)

186 187 188
  * Replace the `Data.List`-exported functions

    ```
189 190
    all, and, any, concat, concatMap, elem, find, product, sum,
    mapAccumL, mapAccumR
191 192
    ```

193 194 195 196
    by re-exports of their generalised `Data.Foldable`/`Data.Traversable`
    counterparts.  In other words, unqualified imports of `Data.List`
    and `Data.Foldable`/`Data.Traversable` no longer lead to conflicting
    definitions. (#9586)
197

198 199 200 201
  * New (unofficial) module `GHC.OldList` containing only list-specialised
    versions of the functions from `Data.List` (in other words, `GHC.OldList`
    corresponds to `base-4.7.0.2`'s `Data.List`)

202 203 204
  * Replace the `Control.Monad`-exported functions

    ```
205 206
    sequence_, msum, mapM_, forM_,
    forM, mapM, sequence
207 208
    ```

209 210 211 212
    by re-exports of their generalised `Data.Foldable`/`Data.Traversable`
    counterparts.  In other words, unqualified imports of `Control.Monad`
    and `Data.Foldable`/`Data.Traversable` no longer lead to conflicting
    definitions. (#9586)
213

214 215 216
  * Generalise `Control.Monad.{when,unless,guard}` from `Monad` to
    `Applicative` and from `MonadPlus` to `Alternative` respectively.

217 218
  * Generalise `Control.Monad.{foldM,foldM_}` to `Foldable`

David Feuer's avatar
David Feuer committed
219 220
  * `scanr`, `mapAccumL` and `filterM` now take part in list fusion (#9355,
    #9502, #9546)
221

222 223
  * Remove deprecated `Data.OldTypeable` (#9639)

224 225 226
  * New module `Data.Bifunctor` providing the `Bifunctor(bimap,first,second)`
    class (previously defined in `bifunctors` package) (#9682)

227 228 229
  * New module `Data.Void` providing the canonical uninhabited type `Void`
    (previously defined in `void` package) (#9814)

230 231
  * Update Unicode class definitions to Unicode version 7.0

232 233
  * Add `Alt`, an `Alternative` wrapper, to `Data.Monoid`. (#9759)

234 235
  * Add `isSubsequenceOf` to `Data.List` (#9767)

236 237 238 239
  * The arguments to `==` and `eq` in `Data.List.nub` and `Data.List.nubBy`
    are swapped, such that `Data.List.nubBy (<) [1,2]` now returns `[1]`
    instead of `[1,2]` (#2528, #3280, #7913)

240 241 242
  * New module `Data.Functor.Identity` (previously provided by `transformers`
    package). (#9664)

243 244 245
  * Add `scanl'`, a strictly accumulating version of `scanl`, to `Data.List`
    and `Data.OldList`. (#9368)

246 247
  * Add `fillBytes` to `Foreign.Marshal.Utils`.

248 249
  * Add new `displayException` method to `Exception` typeclass. (#9822)

250 251 252
  * Add `Data.Bits.toIntegralSized`, a size-checked version of
    `fromIntegral`. (#9816)

253 254 255 256
  * New module `Numeric.Natural` providing new `Natural` type
    representing non-negative arbitrary-precision integers.  The `GHC.Natural`
    module exposes additional GHC-specific primitives. (#9818)

257 258 259 260
  * Add `(Storable a, Integeral a) => Storable (Ratio a)` instance (#9826)

  * Add `Storable a => Storable (Complex a)` instance (#9826)

261 262
  * New module `GHC.RTS.Flags` that provides accessors to runtime flags.

263 264 265 266 267 268 269 270 271
  * Expose functions for per-thread allocation counters and limits in `GHC.Conc`

        disableAllocationLimit :: IO ()
        enableAllocationLimit :: IO ()
        getAllocationCounter :: IO Int64
        setAllocationCounter :: Int64 -> IO ()

    together with a new exception `AllocationLimitExceeded`.

272 273
  * Make `read . show = id` for `Data.Fixed` (#9240)

274
  * Add `calloc` and `callocBytes` to `Foreign.Marshal.Alloc`. (#9859)
275

276
  * Add `callocArray` and `callocArray0` to `Foreign.Marshal.Array`. (#9859)
277

278 279
  * Restore invariant in `Data (Ratio a)` instance (#10011)

280 281
  * Add/expose `rnfTypeRep`, `rnfTyCon`, `typeRepFingerprint`, and
    `tyConFingerprint` helpers to `Data.Typeable`.
282

283 284
  * Define proper `MINIMAL` pragma for `class Ix`. (#10142)

285 286 287 288 289 290 291 292
## 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)

293 294 295 296 297 298 299 300 301 302 303 304 305
## 4.7.0.1  *Jul 2014*

  * Bundled with GHC 7.8.3

  * Unhide `Foreign.ForeignPtr` in Haddock (#8475)

  * Fix recomputation of `TypeRep` in `Typeable` type-application instance
    (#9203)

  * Fix regression in Data.Fixed Read instance (#9231)

  * Fix `fdReady` to honor `FD_SETSIZE` (#9168)

306
## 4.7.0.0  *Apr 2014*
307 308 309

  * Bundled with GHC 7.8.1

310 311 312 313
  * 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 non-compatible way)

314 315 316 317 318 319 320
  * The `Control.Category` module now has the `PolyKinds` extension
    enabled, meaning that instances of `Category` no longer need be of
    kind `* -> * -> *`.

  * There are now `Foldable` and `Traversable` instances for `Either a`,
   `Const r`, and `(,) a`.

321 322
  * There are now `Show`, `Read`, `Eq`, `Ord`, `Monoid`, `Generic`, and
    `Generic1` instances for `Const`.
323 324 325

  * There is now a `Data` instance for `Data.Version`.

326 327 328 329 330
  * A new `Data.Bits.FiniteBits` class has been added to represent
    types with fixed bit-count. The existing `Bits` class is extended
    with a `bitSizeMaybe` method to replace the now obsolete
    `bitsize` method.

331 332 333
  * `Data.Bits.Bits` gained a new `zeroBits` method which completes the
    `Bits` API with a direct way to introduce a value with all bits cleared.

334 335
  * There are now `Bits` and `FiniteBits` instances for `Bool`.

336 337
  * There are now `Eq`, `Ord`, `Show`, `Read`, `Generic`. and `Generic1`
    instances for `ZipList`.
338 339 340 341 342 343 344

  * There are now `Eq`, `Ord`, `Show` and `Read` instances for `Down`.

  * There are now `Eq`, `Ord`, `Show`, `Read` and `Generic` instances
    for types in GHC.Generics (`U1`, `Par1`, `Rec1`, `K1`, `M1`,
    `(:+:)`, `(:*:)`, `(:.:)`).

345 346 347 348 349 350
  * `Data.Monoid`: There are now `Generic` instances for `Dual`, `Endo`,
    `All`, `Any`, `Sum`, `Product`, `First`, and `Last`; as well as
    `Generic1` instances for `Dual`, `Sum`, `Product`, `First`, and `Last`.

  * The `Data.Monoid.{Product,Sum}` newtype wrappers now have `Num` instances.

351 352 353
  * There are now `Functor` instances for `System.Console.GetOpt`'s
    `ArgOrder`, `OptDescr`, and `ArgDescr`.

354 355 356 357 358
  * A zero-width unboxed poly-kinded `Proxy#` was added to
    `GHC.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.

359 360
  * New `Data.Proxy` module providing a concrete, poly-kinded proxy type.

361 362 363 364
  * New `Data.Coerce` module which exports the new `Coercible` class
    together with the `coerce` primitive which provide safe coercion
    (wrt role checking) between types with same representation.

365 366 367 368 369 370 371
  * `Control.Concurrent.MVar` has a new implementation of `readMVar`,
    which fixes a long-standing bug where `readMVar` is only atomic if
    there are no other threads running `putMVar`.  `readMVar` now is
    atomic, and is guaranteed to return the value from the first
    `putMVar`.  There is also a new `tryReadMVar` which is a
    non-blocking version.

372 373 374 375
  * New `Control.Concurrent.MVar.withMVarMasked` which executes
    `IO` action with asynchronous exceptions masked in the same style
    as the existing `modifyMVarMasked` and `modifyMVarMasked_`.

376 377 378 379 380 381 382 383 384
  * New `threadWait{Read,Write}STM :: Fd -> IO (STM (), IO ())`
    functions added to `Control.Concurrent` for waiting on FD
    readiness with STM actions.

  * Expose `Data.Fixed.Fixed`'s constructor.

  * There are now byte endian-swapping primitives
    `byteSwap{16,32,64}` available in `Data.Word`, which use
    optimized machine instructions when available.
385 386 387 388

  * `Data.Bool` now exports `bool :: a -> a -> Bool -> a`, analogously
    to `maybe` and `either` in their respective modules.

389 390 391 392 393 394 395
  * `Data.Either` now exports `isLeft, isRight :: Either a b -> Bool`.

  * `Debug.Trace` now exports `traceId`, `traceShowId`, `traceM`,
    and `traceShowM`.

  * `Data.Functor` now exports `($>)` and `void`.

396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411
  * Rewrote portions of `Text.Printf`, and made changes to `Numeric`
    (added `Numeric.showFFloatAlt` and `Numeric.showGFloatAlt`) and
    `GHC.Float` (added `formatRealFloatAlt`) to support it.  The
    rewritten version is extensible to user types, adds a "generic"
    format specifier "`%v`", extends the `printf` spec to support much
    of C's `printf(3)` functionality, and fixes the spurious warnings
    about using `Text.Printf.printf` at `(IO a)` while ignoring the
    return value.  These changes were contributed by Bart Massey.

  * The minimal complete definitions for all type-classes with cyclic
    default implementations have been explicitly annotated with the
    new `{-# MINIMAL #-}` pragma.

  * `Control.Applicative.WrappedMonad`, which can be used to convert a
    `Monad` to an `Applicative`, has now a
    `Monad m => Monad (WrappedMonad m)` instance.
412

413 414 415
  * There is now a `Generic` and a `Generic1` instance for `WrappedMonad`
    and `WrappedArrow`.

416 417 418 419 420 421 422 423 424 425 426
  * Handle `ExitFailure (-sig)` on Unix by killing process with signal `sig`.

  * New module `Data.Type.Bool` providing operations on type-level booleans.

  * Expose `System.Mem.performMinorGC` for triggering minor GCs.

  * New `System.Environment.{set,unset}Env` for manipulating
    environment variables.

  * Add `Typeable` instance for `(->)` and `RealWorld`.

427
  * Declare CPP header `<Typeable.h>` officially obsolete as GHC 7.8+
428 429 430 431 432 433 434 435 436
    does not support hand-written `Typeable` instances anymore.

  * Remove (unmaintained) Hugs98 and NHC98 specific code.

  * Optimize `System.Timeout.timeout` for the threaded RTS.

  * Remove deprecated functions `unsafeInterleaveST`, `unsafeIOToST`,
    and `unsafeSTToIO` from `Control.Monad.ST`.

437 438 439 440
  * Add a new superclass `SomeAsyncException` for all asynchronous exceptions
    and makes the existing `AsyncException` and `Timeout` exception children
    of `SomeAsyncException` in the hierarchy.

441 442 443 444 445 446 447 448 449
  * Remove deprecated functions `blocked`, `unblock`, and `block` from
    `Control.Exception`.

  * Remove deprecated function `forkIOUnmasked` from `Control.Concurrent`.

  * Remove deprecated function `unsafePerformIO` export from `Foreign`
    (still available via `System.IO.Unsafe.unsafePerformIO`).

  * Various fixes and other improvements (see Git history for full details).