[commit: ghc] master: Implement support for user-defined type errors. (2d1a563)

git at git.haskell.org git at git.haskell.org
Mon Nov 16 21:04:30 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/2d1a563bf25a4e402088feb1cdcac3d7bc50c6d3/ghc

>---------------------------------------------------------------

commit 2d1a563bf25a4e402088feb1cdcac3d7bc50c6d3
Author: Iavor S. Diatchki <iavor.diatchki at gmail.com>
Date:   Mon Nov 16 17:08:14 2015 +0100

    Implement support for user-defined type errors.
    
    Implements Lennart's idea from the Haskell Symposium.
    Users may use the special type function `TypeError`, which is
    similar to `error` at the value level.
    
    See Trac ticket https://ghc.haskell.org/trac/ghc/ticket/9637, and wiki
    page https://ghc.haskell.org/trac/ghc/wiki/CustomTypeErros
    
    Test Plan: Included testcases
    
    Reviewers: simonpj, austin, hvr, goldfire, bgamari
    
    Reviewed By: goldfire, bgamari
    
    Subscribers: adamgundry, thomie
    
    Differential Revision: https://phabricator.haskell.org/D1236
    
    GHC Trac Issues: #9637


>---------------------------------------------------------------

2d1a563bf25a4e402088feb1cdcac3d7bc50c6d3
 compiler/prelude/PrelNames.hs                      | 47 +++++++++++++++++++++
 compiler/typecheck/TcErrors.hs                     | 18 +++++++-
 compiler/typecheck/TcRnTypes.hs                    | 21 +++++++++-
 compiler/typecheck/TcValidity.hs                   | 12 ++++++
 compiler/types/Type.hs                             | 48 +++++++++++++++++++++-
 compiler/types/TypeRep.hs                          |  3 ++
 libraries/base/GHC/TypeLits.hs                     | 27 ++++++++++++
 .../typecheck/should_fail/CustomTypeErrors01.hs    | 14 +++++++
 .../should_fail/CustomTypeErrors01.stderr          |  5 +++
 .../typecheck/should_fail/CustomTypeErrors02.hs    | 19 +++++++++
 .../should_fail/CustomTypeErrors02.stderr          | 10 +++++
 .../typecheck/should_fail/CustomTypeErrors03.hs    |  7 ++++
 .../should_fail/CustomTypeErrors03.stderr          |  5 +++
 testsuite/tests/typecheck/should_fail/all.T        |  5 +++
 14 files changed, 237 insertions(+), 4 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 2d1a563bf25a4e402088feb1cdcac3d7bc50c6d3


More information about the ghc-commits mailing list