diff options
Diffstat (limited to 'docs/users_guide')
-rw-r--r-- | docs/users_guide/8.10.1-notes.rst | 13 | ||||
-rw-r--r-- | docs/users_guide/8.12.1-notes.rst | 98 | ||||
-rw-r--r-- | docs/users_guide/bugs.rst | 39 | ||||
-rw-r--r-- | docs/users_guide/debug-info.rst | 2 | ||||
-rw-r--r-- | docs/users_guide/ghci.rst | 4 | ||||
-rw-r--r-- | docs/users_guide/glasgow_exts.rst | 49 | ||||
-rw-r--r-- | docs/users_guide/index.rst | 1 | ||||
-rw-r--r-- | docs/users_guide/runtime_control.rst | 3 | ||||
-rw-r--r-- | docs/users_guide/safe_haskell.rst | 2 | ||||
-rw-r--r-- | docs/users_guide/separate_compilation.rst | 2 | ||||
-rw-r--r-- | docs/users_guide/using-warnings.rst | 7 |
11 files changed, 191 insertions, 29 deletions
diff --git a/docs/users_guide/8.10.1-notes.rst b/docs/users_guide/8.10.1-notes.rst index e5ed23ca3e..4e9a9fc613 100644 --- a/docs/users_guide/8.10.1-notes.rst +++ b/docs/users_guide/8.10.1-notes.rst @@ -152,7 +152,7 @@ Language Because GHC needs to look under a type family to see that ``a`` is determined by the right-hand side of ``F2``\'s equation, this now needs ``-XUndecidableInstances``. The problem is very much akin to its need to detect some functional dependencies. - + Compiler ~~~~~~~~ @@ -203,6 +203,9 @@ Compiler and much more. See the :ref:`user guide <dynflags_plugins>` for more details as well as an example. +- Deprecated flag :ghc-flag:`-fmax-pmcheck-iterations` in favor of + :ghc-flag:`-fmax-pmcheck-models`, which uses a completely different mechanism. + GHCi ~~~~ @@ -274,6 +277,14 @@ Template Haskell tStr :: String tStr = show MkT +- TH splices by default don't generate warnings anymore. For example, + ``$([d| f :: Int -> void; f x = case x of {} |])`` used to generate a + pattern-match exhaustivity warning, which now it doesn't. The user can + activate warnings for TH splices with :ghc-flag:`-fenable-th-splice-warnings`. + The reason for opt-in is that the offending code might not have been generated + by code the user has control over, for example the ``singletons`` or ``lens`` + library. + ``ghc-prim`` library ~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/users_guide/8.12.1-notes.rst b/docs/users_guide/8.12.1-notes.rst new file mode 100644 index 0000000000..94979e80c4 --- /dev/null +++ b/docs/users_guide/8.12.1-notes.rst @@ -0,0 +1,98 @@ +.. _release-8-12-1: + +Release notes for version 8.12.1 +================================ + +The significant changes to the various parts of the compiler are listed in the +following sections. + + +Highlights +---------- + +- TODO + +Full details +------------ + +Language +~~~~~~~~ + +Compiler +~~~~~~~~ + + +GHCi +~~~~ + + +Runtime system +~~~~~~~~~~~~~~ + +Template Haskell +~~~~~~~~~~~~~~~~ + +``ghc-prim`` library +~~~~~~~~~~~~~~~~~~~~ + +``ghc`` library +~~~~~~~~~~~~~~~ + + - The type of the ``getAnnotations`` function has changed to better reflect + the fact that it returns two different kinds of annotations, those on + names and those on modules: :: + + getAnnotations :: Typeable a + => ([Word8] -> a) -> ModGuts + -> CoreM (ModuleEnv [a], NameEnv [a]) + + +``base`` library +~~~~~~~~~~~~~~~~ + +Build system +~~~~~~~~~~~~ + +Included libraries +------------------ + +The package database provided with this distribution also contains a number of +packages other than GHC itself. See the changelogs provided with these packages +for further change information. + +.. ghc-package-list:: + + libraries/array/array.cabal: Dependency of ``ghc`` library + libraries/base/base.cabal: Core library + libraries/binary/binary.cabal: Dependency of ``ghc`` library + libraries/bytestring/bytestring.cabal: Dependency of ``ghc`` library + libraries/Cabal/Cabal/Cabal.cabal: Dependency of ``ghc-pkg`` utility + libraries/containers/containers/containers.cabal: Dependency of ``ghc`` library + libraries/deepseq/deepseq.cabal: Dependency of ``ghc`` library + libraries/directory/directory.cabal: Dependency of ``ghc`` library + libraries/filepath/filepath.cabal: Dependency of ``ghc`` library + compiler/ghc.cabal: The compiler itself + libraries/ghci/ghci.cabal: The REPL interface + libraries/ghc-boot/ghc-boot.cabal: Internal compiler library + libraries/ghc-boot-th/ghc-boot-th.cabal: Internal compiler library + libraries/ghc-compact/ghc-compact.cabal: Core library + libraries/ghc-heap/ghc-heap.cabal: GHC heap-walking library + libraries/ghc-prim/ghc-prim.cabal: Core library + libraries/haskeline/haskeline.cabal: Dependency of ``ghci`` executable + libraries/hpc/hpc.cabal: Dependency of ``hpc`` executable + libraries/integer-gmp/integer-gmp.cabal: Core library + libraries/libiserv/libiserv.cabal: Internal compiler library + libraries/mtl/mtl.cabal: Dependency of ``Cabal`` library + libraries/parsec/parsec.cabal: Dependency of ``Cabal`` library + libraries/pretty/pretty.cabal: Dependency of ``ghc`` library + libraries/process/process.cabal: Dependency of ``ghc`` library + libraries/stm/stm.cabal: Dependency of ``haskeline`` library + libraries/template-haskell/template-haskell.cabal: Core library + libraries/terminfo/terminfo.cabal: Dependency of ``haskeline`` library + libraries/text/text.cabal: Dependency of ``Cabal`` library + libraries/time/time.cabal: Dependency of ``ghc`` library + libraries/transformers/transformers.cabal: Dependency of ``ghc`` library + libraries/unix/unix.cabal: Dependency of ``ghc`` library + libraries/Win32/Win32.cabal: Dependency of ``ghc`` library + libraries/xhtml/xhtml.cabal: Dependency of ``haddock`` executable + diff --git a/docs/users_guide/bugs.rst b/docs/users_guide/bugs.rst index c0cffa0ee8..4dc49f0328 100644 --- a/docs/users_guide/bugs.rst +++ b/docs/users_guide/bugs.rst @@ -49,6 +49,45 @@ Lexical syntax reserving ``forall`` as a keyword has significance. For instance, GHC will not parse the type signature ``foo :: forall x``. +- The ``(!)`` operator, when written in prefix form (preceded by whitespace + and not followed by whitespace, as in ``f !x = ...``), is interpreted as a + bang pattern, contrary to the Haskell Report, which prescribes to treat ``!`` + as an operator regardless of surrounding whitespace. Note that this does not + imply that GHC always enables :extension:`BangPatterns`. Without the + extension, GHC will issue a parse error on ``f !x``, asking to enable the + extension. + +- Irrefutable patterns must be written in prefix form:: + + f ~a ~b = ... -- accepted by both GHC and the Haskell Report + f ~ a ~ b = ... -- accepted by the Haskell Report but not GHC + + When written in non-prefix form, ``(~)`` is treated by GHC as a regular + infix operator. + + See `GHC Proposal #229 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst>`__ + for the precise rules. + +- Strictness annotations in data declarations must be written in prefix form:: + + data T = MkT !Int -- accepted by both GHC and the Haskell Report + data T = MkT ! Int -- accepted by the Haskell Report but not GHC + + See `GHC Proposal #229 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst>`__ + for the precise rules. + +- As-patterns must not be surrounded by whitespace:: + + f p@(x, y, z) = ... -- accepted by both GHC and the Haskell Report + f p @ (x, y, z) = ... -- accepted by the Haskell Report but not GHC + + When surrounded by whitespace, ``(@)`` is treated by GHC as a regular infix + operator. + + See `GHC Proposal #229 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst>`__ + for the precise rules. + + .. _infelicities-syntax: Context-free syntax diff --git a/docs/users_guide/debug-info.rst b/docs/users_guide/debug-info.rst index 25491f7e43..45792c65df 100644 --- a/docs/users_guide/debug-info.rst +++ b/docs/users_guide/debug-info.rst @@ -147,7 +147,7 @@ this point in the program, For this reason we should be cautious when interpreting the source locations provided by GDB. While these locations will usually be in some sense - "correct", they aren't always useful. This is why profiling tools targetting + "correct", they aren't always useful. This is why profiling tools targeting Haskell should supplement the standard source location information with GHC-specific annotations (emitted with ``-g2``) when assigning costs. diff --git a/docs/users_guide/ghci.rst b/docs/users_guide/ghci.rst index d1229ed0d5..35a49766b4 100644 --- a/docs/users_guide/ghci.rst +++ b/docs/users_guide/ghci.rst @@ -2121,7 +2121,7 @@ On systems with ``.dll``-style shared libraries, the actual library loaded will be ``lib.dll``, ``liblib.dll``. GHCi also has full support for import libraries, either Microsoft style ``.lib``, or GNU GCC style ``.a`` and ``.dll.a`` libraries. If you have an import library it is advisable to always -specify the import libary instead of the ``.dll``. e.g. use ``-lgcc` instead of +specify the import library instead of the ``.dll``. e.g. use ``-lgcc` instead of ``-llibgcc_s_seh-1``. Again, GHCi will signal an error if it can't find the library. @@ -2387,7 +2387,7 @@ commonly used commands. Attempting to redefine an existing command name results in an error unless the ``:def!`` form is used, in which case the old command with that name is silently overwritten. However for builtin commands - the old command can still be used by preceeding the command name with + the old command can still be used by preceding the command name with a double colon (eg ``::load``). It's not possible to redefine the commands ``:{``, ``:}`` and ``:!``. diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index ec015aa673..7ba170845a 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -6956,7 +6956,7 @@ like this: client to deliberately override an instance from a library, without requiring a change to the library.) -- If all the remaining candidates are incoherent, the search suceeds, returning +- If all the remaining candidates are incoherent, the search succeeds, returning an arbitrary surviving candidate. - If more than one non-incoherent candidate remains, the search fails. @@ -8784,7 +8784,7 @@ injectivity of a type family: 5. In a *closed type family* all equations are ordered and in one place. Equations are also checked pair-wise but this time an equation has to - be paired with all the preceeding equations. Of course a + be paired with all the preceding equations. Of course a single-equation closed type family is trivially injective (unless (1), (2) or (3) above holds). @@ -13108,10 +13108,9 @@ enable the quotation subset of Template Haskell (i.e. without splice syntax). The :extension:`TemplateHaskellQuotes` extension is considered safe under :ref:`safe-haskell` while :extension:`TemplateHaskell` is not. -- A splice is written ``$x``, where ``x`` is an identifier, or - ``$(...)``, where the "..." is an arbitrary expression. There must be - no space between the "$" and the identifier or parenthesis. This use - of "$" overrides its meaning as an infix operator, just as "M.x" +- A splice is written ``$x``, where ``x`` is an arbitrary expression. + There must be no space between the "$" and the expression. + This use of "$" overrides its meaning as an infix operator, just as "M.x" overrides the meaning of "." as an infix operator. If you want the infix operator, put spaces around it. @@ -13147,9 +13146,8 @@ The :extension:`TemplateHaskellQuotes` extension is considered safe under See :ref:`pts-where` for using partial type signatures in quotations. -- A *typed* expression splice is written ``$$x``, where ``x`` is an - identifier, or ``$$(...)``, where the "..." is an arbitrary - expression. +- A *typed* expression splice is written ``$$x``, where ``x`` is + is an arbitrary expression. A typed expression splice can occur in place of an expression; the spliced expression must have type ``Q (TExp a)`` @@ -13404,6 +13402,17 @@ The syntax for a declaration splice uses "``$``" not "``splice``". The type of the enclosed expression must be ``Q [Dec]``, not ``[Q Dec]``. Typed expression splices and quotations are supported.) +.. ghc-flag:: -fenable-th-splice-warnings + :shortdesc: Generate warnings for Template Haskell splices + :type: dynamic + :reverse: -fno-enable-th-splices + :category: warnings + + Template Haskell splices won't be checked for warnings, because the code + causing the warning might originate from a third-party library and possibly + was not written by the user. If you want to have warnings for splices + anyway, pass :ghc-flag:`-fenable-th-splice-warnings`. + .. _th-usage: Using Template Haskell @@ -14312,12 +14321,15 @@ Note the following points: f !x = 3 - Is this a definition of the infix function "``(!)``", or of the "``f``" - with a bang pattern? GHC resolves this ambiguity in favour of the - latter. If you want to define ``(!)`` with bang-patterns enabled, you - have to do so using prefix notation: :: + Is this a definition of the infix function "``(!)``", or of the "``f``" with + a bang pattern? GHC resolves this ambiguity by looking at the surrounding + whitespace: :: - (!) f x = 3 + a ! b = ... -- infix operator + a !b = ... -- bang pattern + + See `GHC Proposal #229 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst>`__ + for the precise rules. .. _strict-data: @@ -14348,6 +14360,13 @@ we interpret it as if they had written :: The extension only affects definitions in this module. +The ``~`` annotation must be written in prefix form:: + + data T = MkT ~Int -- valid + data T = MkT ~ Int -- invalid + +See `GHC Proposal #229 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst>`__ +for the precise rules. .. _strict: @@ -14382,7 +14401,7 @@ optionally had by adding ``!`` in front of a variable. Adding ``~`` in front of ``x`` gives the regular lazy behavior. - Turning patterns into irrefutable ones requires ``~(~p)`` or ``(~ ~p)`` when ``Strict`` is enabled. + Turning patterns into irrefutable ones requires ``~(~p)`` when ``Strict`` is enabled. diff --git a/docs/users_guide/index.rst b/docs/users_guide/index.rst index e629af67a5..00e14409c4 100644 --- a/docs/users_guide/index.rst +++ b/docs/users_guide/index.rst @@ -14,6 +14,7 @@ Contents: intro 8.8.1-notes 8.10.1-notes + 8.12.1-notes ghci runghc usage diff --git a/docs/users_guide/runtime_control.rst b/docs/users_guide/runtime_control.rst index 1f4b766400..f6dd9a62e8 100644 --- a/docs/users_guide/runtime_control.rst +++ b/docs/users_guide/runtime_control.rst @@ -77,7 +77,8 @@ the end of the command line, as in this example: If you absolutely positively want all the rest of the options in a command line to go to the program (and not the RTS), use a -``--RTS``. +``--RTS`` or ``--``. The difference is that ``--RTS`` will not be passed to +the program, while ``--`` will. As always, for RTS options that take ⟨size⟩s: If the last character of ⟨size⟩ is a K or k, multiply by 1000; if an M or m, by 1,000,000; if a G diff --git a/docs/users_guide/safe_haskell.rst b/docs/users_guide/safe_haskell.rst index b95364531f..edfedda4b2 100644 --- a/docs/users_guide/safe_haskell.rst +++ b/docs/users_guide/safe_haskell.rst @@ -788,7 +788,7 @@ And five warning flags: .. index:: single: safe haskell imports, warning - The module ``A`` below is annotated to be explictly ``Safe``, but it imports + The module ``A`` below is annotated to be explicitly ``Safe``, but it imports ``Safe-Inferred`` module. :: {-# LANGUAGE Safe #-} diff --git a/docs/users_guide/separate_compilation.rst b/docs/users_guide/separate_compilation.rst index 716dd92223..11cd2cfc4e 100644 --- a/docs/users_guide/separate_compilation.rst +++ b/docs/users_guide/separate_compilation.rst @@ -597,7 +597,7 @@ The GHC API exposes functions for reading and writing these files. Runs a series of sanity checks and lints on the extended interface files that are being written out. These include testing things properties such as - variables not occuring outside of their expected scopes. + variables not occurring outside of their expected scopes. The format in which GHC currently stores its typechecked AST, makes it costly to collect the types for some expressions nodes. For the sake of performance, diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index 62b644aa8a..4649f86de0 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -46,7 +46,6 @@ generally likely to indicate bugs in your program. These are: * :ghc-flag:`-Winaccessible-code` * :ghc-flag:`-Wstar-is-type` * :ghc-flag:`-Wstar-binder` - * :ghc-flag:`-Wspace-after-bang` The following flags are simple ways to select standard "packages" of warnings: @@ -1280,12 +1279,6 @@ of ``-W(no-)*``. per-module basis with :ghc-flag:`-Wno-simplifiable-class-constraints <-Wsimplifiable-class-constraints>`. -.. ghc-flag:: -Wspace-after-bang - :shortdesc: warn for missing space before the second argument - of an infix definition of ``(!)`` when - :extension:`BangPatterns` are not enabled - :type: dynamic - :reverse: -Wno-missing-space-after-bang .. ghc-flag:: -Wtabs :shortdesc: warn if there are tabs in the source file :type: dynamic |