Re: [commit: ghc] master: Overlapable pragmas for individual instances (#9242) (6290eea)

Hi, Fyi, this changeset seems to have broken ./validate: utils/haddock/src/Haddock/Interface/Rename.hs:449:11: Warning: Fields of ‘ClsInstDecl’ not initialised: cid_overlap_mode In the first argument of ‘return’, namely ‘(ClsInstDecl {cid_poly_ty = ltype', cid_binds = emptyBag, cid_sigs = [], cid_tyfam_insts = lATs', cid_datafam_insts = lADTs'})’ In a stmt of a 'do' block: return (ClsInstDecl {cid_poly_ty = ltype', cid_binds = emptyBag, cid_sigs = [], cid_tyfam_insts = lATs', cid_datafam_insts = lADTs'}) In the expression: do { ltype' <- renameLType ltype; lATs' <- mapM (mapM renameTyFamInstD) lATs; lADTs' <- mapM (mapM renameDataFamInstD) lADTs; return (ClsInstDecl {cid_poly_ty = ltype', cid_binds = emptyBag, cid_sigs = [], cid_tyfam_insts = lATs', cid_datafam_insts = lADTs'}) } <no location info>: Failing due to -Werror. make[1]: *** [utils/haddock/dist/build/Haddock/Interface/Rename.dyn_o] Error 1 make: *** [all] Error 2 On 2014-06-30 at 02:37:52 +0200, git-4Dsf34iY/NkouOHNgZ69ag@public.gmane.org wrote:
Repository : ssh://git@git.haskell.org/ghc
On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6290eeadf61a40f2eb08d0fd7ef1f3b7f9...
---------------------------------------------------------------
commit 6290eeadf61a40f2eb08d0fd7ef1f3b7f9804178 Author: Iavor S. Diatchki
Date: Sun Jun 29 17:22:16 2014 -0700 Overlapable pragmas for individual instances (#9242)
Programmers may provide a pragma immediately after the `instance` keyword to control the overlap/incoherence behavior for individual instances. For example:
instance {-# OVERLAP #-} C a where ...
I chose this notation, rather than the other two outlined in the ticket for these reasons:
1. Having the pragma after the type looks odd, I think. 2. Having the pragma after there `where` does not work for stand-alone derived instances
I have implemented 3 pragams:
1. NO_OVERLAP 2. OVERLAP 3. INCOHERENT
These correspond directly to the internal modes currently supported by GHC. If a pragma is specified, it will be used no matter what flags are turned on. For example, putting `NO_OVERLAP` on an instance will mark it as non-overlapping, even if `OVERLAPPIN_INSTANCES` is turned on for the module.
---------------------------------------------------------------
6290eeadf61a40f2eb08d0fd7ef1f3b7f9804178 compiler/hsSyn/Convert.lhs | 2 +- compiler/hsSyn/HsDecls.lhs | 24 ++++++++++++++++---- compiler/parser/Lexer.x | 6 +++++ compiler/parser/Parser.y.pp | 21 +++++++++++++----- compiler/rename/RnSource.lhs | 7 ++++-- compiler/typecheck/TcDeriv.lhs | 46 +++++++++++++++++++++++++-------------- compiler/typecheck/TcInstDcls.lhs | 5 ++++- 7 files changed, 82 insertions(+), 29 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 6290eeadf61a40f2eb08d0fd7ef1f3b7f9804178
-- "Elegance is not optional" -- Richard O'Keefe

Sorry about this. It would appear that I am not allowed to push to the
`haddock` repo, so I've attached a patch, for someone with permissions to
apply.
Also, could I be given permissions to modify haddock, since GHC and haddock
are closely related changes like the one I made often need to be propagated
in both.
-Iavor
On Mon, Jun 30, 2014 at 1:23 AM, Herbert Valerio Riedel
Hi,
Fyi, this changeset seems to have broken ./validate:
utils/haddock/src/Haddock/Interface/Rename.hs:449:11: Warning: Fields of ‘ClsInstDecl’ not initialised: cid_overlap_mode In the first argument of ‘return’, namely ‘(ClsInstDecl {cid_poly_ty = ltype', cid_binds = emptyBag, cid_sigs = [], cid_tyfam_insts = lATs', cid_datafam_insts = lADTs'})’ In a stmt of a 'do' block: return (ClsInstDecl {cid_poly_ty = ltype', cid_binds = emptyBag, cid_sigs = [], cid_tyfam_insts = lATs', cid_datafam_insts = lADTs'}) In the expression: do { ltype' <- renameLType ltype; lATs' <- mapM (mapM renameTyFamInstD) lATs; lADTs' <- mapM (mapM renameDataFamInstD) lADTs; return (ClsInstDecl {cid_poly_ty = ltype', cid_binds = emptyBag, cid_sigs = [], cid_tyfam_insts = lATs', cid_datafam_insts = lADTs'}) }
<no location info>: Failing due to -Werror. make[1]: *** [utils/haddock/dist/build/Haddock/Interface/Rename.dyn_o] Error 1 make: *** [all] Error 2
On 2014-06-30 at 02:37:52 +0200, git-4Dsf34iY/ NkouOHNgZ69ag@public.gmane.org wrote:
Repository : ssh://git@git.haskell.org/ghc
On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6290eeadf61a40f2eb08d0fd7ef1f3b7f9...
---------------------------------------------------------------
commit 6290eeadf61a40f2eb08d0fd7ef1f3b7f9804178 Author: Iavor S. Diatchki
Date: Sun Jun 29 17:22:16 2014 -0700 Overlapable pragmas for individual instances (#9242)
Programmers may provide a pragma immediately after the `instance` keyword to control the overlap/incoherence behavior for individual instances. For example:
instance {-# OVERLAP #-} C a where ...
I chose this notation, rather than the other two outlined in the ticket for these reasons:
1. Having the pragma after the type looks odd, I think. 2. Having the pragma after there `where` does not work for stand-alone derived instances
I have implemented 3 pragams:
1. NO_OVERLAP 2. OVERLAP 3. INCOHERENT
These correspond directly to the internal modes currently supported by GHC. If a pragma is specified, it will be used no matter what flags are turned on. For example, putting `NO_OVERLAP` on an instance will mark it as non-overlapping, even if `OVERLAPPIN_INSTANCES` is turned on for the module.
---------------------------------------------------------------
6290eeadf61a40f2eb08d0fd7ef1f3b7f9804178 compiler/hsSyn/Convert.lhs | 2 +- compiler/hsSyn/HsDecls.lhs | 24 ++++++++++++++++---- compiler/parser/Lexer.x | 6 +++++ compiler/parser/Parser.y.pp | 21 +++++++++++++----- compiler/rename/RnSource.lhs | 7 ++++-- compiler/typecheck/TcDeriv.lhs | 46 +++++++++++++++++++++++++-------------- compiler/typecheck/TcInstDcls.lhs | 5 ++++- 7 files changed, 82 insertions(+), 29 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 6290eeadf61a40f2eb08d0fd7ef1f3b7f9804178
-- "Elegance is not optional" -- Richard O'Keefe

On 2014-06-30 at 22:27:16 +0200, Iavor Diatchki wrote:
Sorry about this. It would appear that I am not allowed to push to the `haddock` repo, so I've attached a patch, for someone with permissions to apply.
Also, could I be given permissions to modify haddock, since GHC and haddock are closely related changes like the one I made often need to be propagated in both.
Sure, I've just added you to the set of users allowed to push to GitHub's haskell/haddock repo. There's a ghc-devs team in the haskell github organization, https://github.com/orgs/haskell/teams/ghc-devs which should ideally contain all committers listed at https://ghc.haskell.org/trac/ghc/wiki/TeamGHC but it's probably out of sync currently.

Sure, I've just added you to the set of users allowed to push to GitHub's haskell/haddock repo.
There's a ghc-devs team in the haskell github organization,
https://github.com/orgs/haskell/teams/ghc-devs This link is broken. Is this the same as:
participants (3)
-
Herbert Valerio Riedel
-
Iavor Diatchki
-
Jan Stolarek