[commit: ghc] master: Fundeps work even for unary type classes (801c263)

git at git.haskell.org git at git.haskell.org
Wed Oct 26 10:13:40 UTC 2016


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/801c26372742fc79bd3756bdcb710031c716c402/ghc

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

commit 801c26372742fc79bd3756bdcb710031c716c402
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Oct 26 10:54:16 2016 +0100

    Fundeps work even for unary type classes
    
    The functional-dependency improvement functions,
       improveFromAnother
       improveFromInstEnv
    had a side-condition that said the type class has to have at
    least two arguments.  But not so, as Trac #12763 shows:
    
       class C a | -> a where ...
    
    is perfectly legal, albeit a bit of a corner case.


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

801c26372742fc79bd3756bdcb710031c716c402
 compiler/typecheck/FunDeps.hs                      |  3 +-
 testsuite/tests/typecheck/should_compile/T12763.hs | 13 +++++
 .../tests/typecheck/should_compile/T12763.stderr   | 14 +++++
 testsuite/tests/typecheck/should_compile/all.T     |  1 +
 testsuite/tests/typecheck/should_fail/T5684.stderr | 60 +++-------------------
 5 files changed, 35 insertions(+), 56 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 801c26372742fc79bd3756bdcb710031c716c402


More information about the ghc-commits mailing list