From ae96c751c869813ab95e712f8daac8516bb4795f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Sinan=20A=C4=9Facan?= Date: Fri, 17 Jul 2015 00:02:09 +0200 Subject: 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 --- docs/users_guide/using.xml | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'docs/users_guide/using.xml') 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 - + @@ -959,6 +959,46 @@ ghci> :t (>>) + + + + + + + + When enabled, GHC also prints type-synonym-expanded types in type + errors. + + For example, with this type synonyms: + + +type Foo = Int +type Bar = Bool +type MyBarST s = ST s Bar + + + This error message: + + +Couldn't match type 'Int' with 'Bool' +Expected type: ST s Foo + Actual type: MyBarST s + + + Becomes this: + + +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 + + + + + -- cgit v1.2.1