[commit: ghc] master: Reify data family instances correctly. (e319d6d)

Richard Eisenberg eir at cis.upenn.edu
Wed Oct 22 14:16:32 UTC 2014


Bah. I think it is the flushing, because I seem to remember that problem happening before. Will try to be more careful next time.

Sorry for the bother, and thanks.

Richard

On Oct 22, 2014, at 4:50 AM, Joachim Breitner <mail at joachim-breitner.de> wrote:

> Hi Richard,
> 
> Travis is complaining about your commit:
> 
> Actual stderr output differs from expected:
> --- ./th/T9692.stderr	2014-10-21 13:22:53.783212762 +0000
> +++ ./th/T9692.comp.stderr	2014-10-21 13:52:36.314083513 +0000
> @@ -1,2 +0,0 @@
> -data family T9692.F (a_0 :: k_1) (b_2 :: k_3) :: *
> -data instance T9692.F GHC.Types.Int x_4 = T9692.FInt x_4
> *** unexpected failure for T9692(normal)
> https://s3.amazonaws.com/archive.travis-ci.org/jobs/38604151/log.txt
> 
> It maybe be due to a missing flushing of stdout; I added that line and
> will let you know if that was not it.
> 
> Greetings,
> Joachim
> 
> Greetings,
> Joachim
> 
> Am Dienstag, den 21.10.2014, 13:21 +0000 schrieb git at git.haskell.org:
>> Repository : ssh://git@git.haskell.org/ghc
>> 
>> On branch  : master
>> Link       : http://ghc.haskell.org/trac/ghc/changeset/e319d6d2704edc2696f47409f85f4d4ce58a6cc4/ghc
>> 
>>> ---------------------------------------------------------------
>> 
>> commit e319d6d2704edc2696f47409f85f4d4ce58a6cc4
>> Author: Richard Eisenberg <eir at cis.upenn.edu>
>> Date:   Mon Oct 20 15:36:57 2014 -0400
>> 
>>    Reify data family instances correctly.
>> 
>>    Summary:
>>    Fix #9692.
>> 
>>    The reifier didn't account for the possibility that data/newtype
>>    instances are sometimes eta-reduced. It now eta-expands as necessary.
>> 
>>    Test Plan: th/T9692
>> 
>>    Reviewers: simonpj, austin
>> 
>>    Subscribers: thomie, carter, ezyang, simonmar
>> 
>>    Differential Revision: https://phabricator.haskell.org/D355
>> 
>> 
>>> ---------------------------------------------------------------
>> 
>> e319d6d2704edc2696f47409f85f4d4ce58a6cc4
>> compiler/typecheck/TcSplice.lhs | 10 +++++++++-
>> 1 file changed, 9 insertions(+), 1 deletion(-)
>> 
>> diff --git a/compiler/typecheck/TcSplice.lhs b/compiler/typecheck/TcSplice.lhs
>> index bb6af8c..e952a27 100644
>> --- a/compiler/typecheck/TcSplice.lhs
>> +++ b/compiler/typecheck/TcSplice.lhs
>> @@ -1338,8 +1338,16 @@ reifyFamilyInstance (FamInst { fi_flavor = flavor
>>       DataFamilyInst rep_tc ->
>>         do { let tvs = tyConTyVars rep_tc
>>                  fam' = reifyName fam
>> +
>> +                   -- eta-expand lhs types, because sometimes data/newtype
>> +                   -- instances are eta-reduced; See Trac #9692
>> +                   -- See Note [Eta reduction for data family axioms]
>> +                   -- in TcInstDcls
>> +                 (_rep_tc, rep_tc_args) = splitTyConApp rhs
>> +                 etad_tyvars            = dropList rep_tc_args tvs
>> +                 eta_expanded_lhs = lhs `chkAppend` mkTyVarTys etad_tyvars
>>            ; cons <- mapM (reifyDataCon (mkTyVarTys tvs)) (tyConDataCons rep_tc)
>> -           ; th_tys <- reifyTypes lhs
>> +           ; th_tys <- reifyTypes (filter (not . isKind) eta_expanded_lhs)
>>            ; return (if isNewTyCon rep_tc
>>                      then TH.NewtypeInstD [] fam' th_tys (head cons) []
>>                      else TH.DataInstD    [] fam' th_tys cons        []) }
>> 
>> _______________________________________________
>> ghc-commits mailing list
>> ghc-commits at haskell.org
>> http://www.haskell.org/mailman/listinfo/ghc-commits
>> 
> 
> -- 
> Joachim “nomeata” Breitner
>  mail at joachim-breitner.dehttp://www.joachim-breitner.de/
>  Jabber: nomeata at joachim-breitner.de  • GPG-Key: 0xF0FBF51F
>  Debian Developer: nomeata at debian.org
> 
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs



More information about the ghc-devs mailing list