diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2015-07-17 00:02:09 +0200 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2015-07-17 00:07:30 +0200 |
commit | ae96c751c869813ab95e712f8daac8516bb4795f (patch) | |
tree | be6c84598963debb99019cb1a90367e5097aedba /docs/users_guide/using.xml | |
parent | 82f1c78718828e0b49fc6f6ed140234e016e4c7a (diff) | |
download | haskell-ae96c751c869813ab95e712f8daac8516bb4795f.tar.gz |
Implement -fprint-expanded-synonyms
Add a flag to print type-synonyms-expanded versions of types in type
error messages (in addition to old error messages with synonyms)
* Mailing list discussion: https://mail.haskell.org/pipermail/ghc-devs/2015-June/009247.html
* Wiki page: https://wiki.haskell.org/Expanding_type_synonyms_in_error_messages_proposal
* Trac: https://ghc.haskell.org/trac/ghc/ticket/10547
Test Plan:
* I'll find some examples and add tests.
Reviewers: austin, simonpj, goldfire, bgamari
Reviewed By: austin, simonpj, goldfire, bgamari
Subscribers: rodlogic, thomie, bgamari
Differential Revision: https://phabricator.haskell.org/D1016
GHC Trac Issues: #10547
Diffstat (limited to 'docs/users_guide/using.xml')
-rw-r--r-- | docs/users_guide/using.xml | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml index 58008a2ade..772e8b9eaa 100644 --- a/docs/users_guide/using.xml +++ b/docs/users_guide/using.xml @@ -896,7 +896,7 @@ ghc -c Foo.hs <varlistentry> - <term><option>--fprint-explicit-foralls, -fprint-explicit-kinds, -fprint-unicode-syntax</option> + <term><option>-fprint-explicit-foralls, -fprint-explicit-kinds, -fprint-unicode-syntax</option> <indexterm><primary><option>-fprint-explicit-foralls</option></primary></indexterm> <indexterm><primary><option>-fprint-explicit-kinds</option></primary></indexterm> <indexterm><primary><option>-fprint-unicode-syntax</option></primary></indexterm> @@ -960,6 +960,46 @@ ghci> :t (>>) </varlistentry> <varlistentry> + <term> + <option>-fprint-expanded-synonyms</option> + <indexterm><primary><option>-fprint-expanded-synonyms</option></primary></indexterm> + </term> + <listitem> + <para> + When enabled, GHC also prints type-synonym-expanded types in type + errors. + + For example, with this type synonyms: + +<screen> +type Foo = Int +type Bar = Bool +type MyBarST s = ST s Bar +</screen> + + This error message: + +<screen> +Couldn't match type 'Int' with 'Bool' +Expected type: ST s Foo + Actual type: MyBarST s +</screen> + + Becomes this: + +<screen> +Couldn't match type 'Int' with 'Bool' +Expected type: ST s Foo + Actual type: MyBarST s +Type synonyms expanded: +Expected type: ST s Int + Actual type: ST s Bool +</screen> + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><option>-ferror-spans</option> <indexterm><primary><option>-ferror-spans</option></primary> </indexterm> |