Implementation of StrictData language extension
authorAdam Sandberg Eriksson <adam@sandbergericsson.se>
Mon, 27 Jul 2015 11:18:36 +0000 (13:18 +0200)
committerBen Gamari <ben@smart-cactus.org>
Mon, 27 Jul 2015 11:49:55 +0000 (13:49 +0200)
commitf842ad6c751c14ec331ca1709538c2f3e9a30ae7
tree5517e0a9d3cf5b896bcdd6d6eb986613b295eaf2
parent474d4ccc6e4a3bea93be16cb7daef6ffcdf9b663
Implementation of StrictData language extension

This implements the `StrictData` language extension, which lets the
programmer default to strict data fields in datatype declarations on a
per-module basis.

Specification and motivation can be found at
https://ghc.haskell.org/trac/ghc/wiki/StrictPragma

This includes a tricky parser change due to conflicts regarding `~` in
the type level syntax: all ~'s are parsed as strictness annotations (see
`strict_mark` in Parser.y) and then turned into equality constraints at
the appropriate places using `RdrHsSyn.splitTilde`.

Updates haddock submodule.

Test Plan: Validate through Harbormaster.

Reviewers: goldfire, austin, hvr, simonpj, tibbe, bgamari

Reviewed By: simonpj, tibbe, bgamari

Subscribers: lelf, simonpj, alanz, goldfire, thomie, bgamari, mpickering

Differential Revision: https://phabricator.haskell.org/D1033

GHC Trac Issues: #8347
24 files changed:
compiler/basicTypes/DataCon.hs
compiler/basicTypes/MkId.hs
compiler/deSugar/DsMeta.hs
compiler/hsSyn/Convert.hs
compiler/hsSyn/HsTypes.hs
compiler/iface/BuildTyCl.hs
compiler/iface/MkIface.hs
compiler/iface/TcIface.hs
compiler/main/DynFlags.hs
compiler/parser/Parser.y
compiler/parser/RdrHsSyn.hs
compiler/prelude/TysWiredIn.hs
compiler/typecheck/TcExpr.hs
compiler/typecheck/TcRnDriver.hs
compiler/typecheck/TcSplice.hs
compiler/typecheck/TcTyClsDecls.hs
compiler/vectorise/Vectorise/Generic/PData.hs
docs/users_guide/flags.xml
docs/users_guide/glasgow_exts.xml
testsuite/tests/deSugar/should_run/DsStrictData.hs [new file with mode: 0644]
testsuite/tests/deSugar/should_run/DsStrictData.stdout [new file with mode: 0644]
testsuite/tests/deSugar/should_run/all.T
testsuite/tests/driver/T4437.hs
utils/haddock