#7633: Checkable "minimal complete definitions"
-------------------------------------+------------------------------------
Reporter: shachaf | Owner:
Type: feature request | Status: patch
Priority: normal | Milestone: 7.8.1
Component: Compiler | Version: 7.6.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets: #6028
-------------------------------------+------------------------------------
Comment (by jstolarek):
twanvl: I feel that work you've done could use more comments. Could you
add some more explanation what and why the code does? I'm thinking mostly
about !BooleanFormula module - there is no comment explaining its purpose
("Boolean formulas without negation (qunatifier free)" is a bit criptic!)
and design decisions that you've made (in 2 or 3 months you will not
remeber them!). Thanks
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7633#comment:34>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
#7633: Checkable "minimal complete definitions"
-------------------------------------+------------------------------------
Reporter: shachaf | Owner:
Type: feature request | Status: patch
Priority: normal | Milestone: 7.8.1
Component: Compiler | Version: 7.6.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets: #6028
-------------------------------------+------------------------------------
Comment (by hvr):
btw, while fixing up some test-cases for the shortly to follow `ghc-prim`
patch, I noticed the following indentation error in T6002
{{{#!hs
instance Eq (Hidden Nat') where
Hide a == Hide b = sameNat' a b
}}}
which triggered a warning now
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7633#comment:31>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
#7633: Checkable "minimal complete definitions"
-------------------------------------+------------------------------------
Reporter: shachaf | Owner:
Type: feature request | Status: patch
Priority: normal | Milestone: 7.8.1
Component: Compiler | Version: 7.6.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets: #6028
-------------------------------------+------------------------------------
Comment (by Herbert Valerio Riedel <hvr@…>):
In [changeset:d72a4dc5d90ac4c32834a3bb00084252cbd042a3/testsuite]:
{{{
#!CommitTicketReference repository="testsuite"
revision="d72a4dc5d90ac4c32834a3bb00084252cbd042a3"
Update to new missing-method-decl warning style
As a side-effect, the new `{-# MINIMAL #-}` facility (see #7633) changes
the existing separate warnings for each missing method declaration:
{{{
No explicit method or default declaration for ‛+’
In the instance declaration for ‛Num T’
}}}
to a single warning per class of the following form:
{{{
No explicit implementation for
‛+’, ‛*’, ‛abs’, ‛signum’, and ‛fromInteger’
In the instance declaration for ‛Num T’
}}}
This commit adapts the reference output files in the testsuite to follow
this change in GHC's warnings messages.
Signed-off-by: Herbert Valerio Riedel <hvr(a)gnu.org>
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7633#comment:29>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
#7633: Checkable "minimal complete definitions"
-------------------------------------+------------------------------------
Reporter: shachaf | Owner:
Type: feature request | Status: patch
Priority: normal | Milestone: 7.8.1
Component: Compiler | Version: 7.6.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets: #6028
-------------------------------------+------------------------------------
Comment (by Herbert Valerio Riedel <hvr@…>):
In [changeset:bd42c9dfd1c9ce19672e1d63871a237c268e0212/ghc]:
{{{
#!CommitTicketReference repository="ghc"
revision="bd42c9dfd1c9ce19672e1d63871a237c268e0212"
Implement checkable "minimal complete definitions" (#7633)
This commit adds a `{-# MINIMAL #-}` pragma, which defines the possible
minimal complete definitions for a class. The body of the pragma is a
boolean formula of names.
The old warning for missing methods is replaced with this new one.
Note: The interface file format is changed to store the minimal complete
definition.
Authored-by: Twan van Laarhoven <twanvl(a)gmail.com>
Signed-off-by: Herbert Valerio Riedel <hvr(a)gnu.org>
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7633#comment:28>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
#8246: Role annotations does not allow the use of parenthesis
-------------------------------------+-------------------------------------
Reporter: DaniilFrumin | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Parser) | Version: 7.7
Keywords: roles | Operating System: Unknown/Multiple
Architecture: Unknown/Multiple | Type of failure: None/Unknown
Difficulty: Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: |
-------------------------------------+-------------------------------------
There is an inconsistency in roles/kinds annotations wrt parenthesis.
For example, the following code compiles just fine
{{{
data A (a::*) = A
}}}
unlike this code
{{{
data A (a@R) = A
}}}
which results in a compilation error:
Unexpected type `a@R' where type variable expected
In the declaration of `A (a@R)'
As Austin Seipp has pointed out, it boils down to simply: 'data A (a) = A'
This also prompts for further
[http://ghc.haskell.org/trac/ghc/wiki/Roles#Roleandkindannotations
discussion] about role annotations in presence of kind annotations [1].
For example, should '((a :: *)@R)' be a correct annotation?
Related (?) ticket: #8185
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8246>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
#8185: Change role annotation syntax
----------------------------------------------+----------------------------
Reporter: goldfire | Owner:
Type: feature request | goldfire
Priority: normal | Status: new
Component: Compiler | Milestone: 7.8.1
Keywords: | Version: 7.7
Architecture: Unknown/Multiple | Operating System:
Difficulty: Moderate (less than a day) | Unknown/Multiple
Blocked By: | Type of failure:
Related Tickets: | None/Unknown
| Test Case:
| Blocking:
----------------------------------------------+----------------------------
Currently, role annotations look like this:
{{{
data Foo a@N = ...
}}}
I've received several criticisms of this syntax:
* It is not backward compatible. If a library wishes to use role
annotations and remain compilable with earlier versions of GHC,
preprocessor commands are necessary.
* It is inscrutable for someone not well-versed in roles.
* It reminds people of as-patterns, which it is unrelated to.
* It is conceivable that it would conflict with type-level as-patterns.
For these reasons, I propose the following:
{{{
data Foo a {-# ROLE Nominal #-} = ...
}}}
This syntax, while verbose, eliminates these concerns, considering that
the new syntax is easily searchable for someone who doesn't know it. I
have proposed something similar on ghc-devs, with no response, so I will
implement it shortly.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8185>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler