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

Iavor Diatchki iavor.diatchki at gmail.com
Mon Jun 30 20:27:16 UTC 2014


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 <hvriedel at gmail.com>
wrote:

> 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 at public.gmane.org wrote:
> > Repository : ssh://git@git.haskell.org/ghc
> >
> > On branch  : master
> > Link       :
> http://ghc.haskell.org/trac/ghc/changeset/6290eeadf61a40f2eb08d0fd7ef1f3b7f9804178/ghc
> >
> >>---------------------------------------------------------------
> >
> > commit 6290eeadf61a40f2eb08d0fd7ef1f3b7f9804178
> > Author: Iavor S. Diatchki <iavor.diatchki at gmail.com>
> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20140630/21c8706f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Propagate-overloading-mode-for-instance-declarations.patch
Type: text/x-patch
Size: 1483 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20140630/21c8706f/attachment-0001.bin>


More information about the ghc-devs mailing list