diff options
author | Frank Steffahn <fdsteffahn@gmail.com> | 2018-08-21 23:37:33 +0200 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-09-20 09:54:45 -0400 |
commit | 4e3f6a0767b57dfa54934eb4fdb27f54db7016ee (patch) | |
tree | 1b3fe1c0c7592c48e19984b6ecc4459121799747 /docs | |
parent | 077b92fa39839a8e83cd87398435424403cf6486 (diff) | |
download | haskell-4e3f6a0767b57dfa54934eb4fdb27f54db7016ee.tar.gz |
users guide: Fix a few issues
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/glasgow_exts.rst | 8 | ||||
-rw-r--r-- | docs/users_guide/using-warnings.rst | 7 |
2 files changed, 9 insertions, 6 deletions
diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 3ce6a6029e..4fd6f1b2af 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -3558,10 +3558,10 @@ More details: module M where data R = R { a,b,c :: Int } module X where - import M( R(a,c) ) - f b = R { .. } + import M( R(R,a,c) ) + f a b = R { .. } - The ``R{..}`` expands to ``R{M.a=a}``, omitting ``b`` since the + The ``R{..}`` expands to ``R{a=a}``, omitting ``b`` since the record field is not in scope, and omitting ``c`` since the variable ``c`` is not in scope (apart from the binding of the record selector ``c``, of course). @@ -15340,7 +15340,7 @@ The solution is to define the instance-specific function yourself, with a pragma to prevent it being inlined too early, and give a RULE for it: :: instance C Bool where - op x y = opBool + op = opBool opBool :: Bool -> Bool -> Bool {-# NOINLINE [1] opBool #-} diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index a715fc1740..d93064b464 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -20,13 +20,16 @@ generally likely to indicate bugs in your program. These are: * :ghc-flag:`-Wdeprecations` * :ghc-flag:`-Wdeprecated-flags` * :ghc-flag:`-Wunrecognised-pragmas` - * :ghc-flag:`-Wduplicate-constraints` * :ghc-flag:`-Wduplicate-exports` * :ghc-flag:`-Woverflowed-literals` * :ghc-flag:`-Wempty-enumerations` * :ghc-flag:`-Wmissing-fields` * :ghc-flag:`-Wmissing-methods` * :ghc-flag:`-Wwrong-do-bind` + * :ghc-flag:`-Wsimplifiable-class-constraints` + * :ghc-flag:`-Wtyped-holes` + * :ghc-flag:`-Wdeferred-type-errors` + * :ghc-flag:`-Wpartial-type-signatures` * :ghc-flag:`-Wunsupported-calling-conventions` * :ghc-flag:`-Wdodgy-foreign-imports` * :ghc-flag:`-Winline-rule-shadowing` @@ -286,7 +289,7 @@ of ``-W(no-)*``. Defer variable out-of-scope errors (errors about names without a leading underscore) until runtime. This will turn variable-out-of-scope errors into warnings. - Using a value that depends on a typed hole produces a runtime error, + Using a value that depends on an out-of-scope variable produces a runtime error, the same as :ghc-flag:`-fdefer-type-errors` (which implies this option). See :ref:`typed-holes` and :ref:`defer-type-errors`. |