#8993 closed bug (fixed)

Fold NullaryTypeClasses into MPTC

Reported by: owst Owned by:
Priority: normal Milestone: 7.10.1
Component: Compiler Version: 7.8.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

NullaryTypeClasses are an instance of MultiParamTypeClasses, so make it so.

Suggested by Austin on reddit

Attachments (1)

0001-Subsume-NullaryTypeClasses-by-MultiParamTypeClasses.patch (8.3 KB) - added by owst 14 months ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 14 months ago by thoughtpolice

  • Status changed from new to patch

comment:2 Changed 14 months ago by simonpj

I'm fine with this, but I think the error message could be better. "Too many args" is better than "Invalid number of args". It would be easy to generate the same messages as before, by passing arity to classArityErr.

Simon

comment:3 Changed 14 months ago by owst

I've uploaded a new patch, which preserves the original messages, as per Simon's suggestion.

Owen.

comment:4 Changed 14 months ago by thoughtpolice

  • Milestone set to 7.10.1

Awesome, thanks!

comment:5 Changed 13 months ago by Krzysztof Gogolewski <krz.gogolewski@…>

In c63a465011b99eeafbb957074e54c2e6bbf751d9/ghc:

Subsume NullaryTypeClasses by MultiParamTypeClasses (#8993)

MPTC now also handles the nullary case

comment:6 Changed 13 months ago by monoidal

  • Resolution set to fixed
  • Status changed from patch to closed

I've pushed - thanks for the patch!

comment:7 Changed 12 months ago by hvr

  • Resolution fixed deleted
  • Status changed from closed to new

It seems that currently NullaryTypeClasses has no effect anymore? Specifically, make WAY=normal TEST=TcNullaryTC fails with

=====> TcNullaryTC(normal) 2009 of 4031 [0, 0, 0] 
cd ./typecheck/should_run && '/home/hvr/Haskell/GHC/ghc/inplace/bin/ghc-stage2' -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-ghci-history -o TcNullaryTC TcNullaryTC.hs    >TcNullaryTC.comp.stderr 2>&1
Compile failed (status 256) errors were:

TcNullaryTC.hs:1:14: Warning:
    -XNullaryTypeClasses is deprecated: use -XMultiParamTypeClasses or pragma {-# LANGUAGE MultiParamTypeClasses #-} instead
[1 of 1] Compiling Main             ( TcNullaryTC.hs, TcNullaryTC.o )

TcNullaryTC.hs:5:1:
    No parameters for class ‘R’
    (Use MultiParamTypeClasses to allow no-parameter classes)
    In the class declaration for ‘R’

*** unexpected failure for TcNullaryTC(normal)

comment:8 Changed 12 months ago by Herbert Valerio Riedel <hvr@…>

In 26f41922e8923185bc77ceb8ef44d23564d29bed/ghc:

Promote TcNullaryTC and TcCoercible to fast tests

I'm wondering whether it's sensible to omit so many typecheck testcases from
the default validate test target. As for instance, TcNullaryTC has been failing
since its introduction in c63a465011b99eeafbb957074e54c2e6bbf751d9 (re #8993) and
it seems to have gone unnoticed so far.

Signed-off-by: Herbert Valerio Riedel <[email protected]>

comment:9 Changed 12 months ago by monoidal

Sorry about that. Will fix.

comment:10 Changed 12 months ago by Krzysztof Gogolewski <krz.gogolewski@…>

In e7b9c4125321308a7f71cacf4c24b7d40261ccfd/ghc:

Fixup nullary typeclasses (Trac #8993)

Summary: Fix test broken after Trac #8993

Test Plan: validate

Reviewers: austin, simonpj, hvr

Reviewed By: austin, hvr

Subscribers: simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D34

comment:11 Changed 12 months ago by monoidal

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.