generic-lens icon indicating copy to clipboard operation
generic-lens copied to clipboard

Tests fieldALensManual === fieldALensType and sum1PrismManual === sum1PrismB failed

Open guibou opened this issue 5 years ago • 2 comments

I'm trying to build generic-lens on nix with ghc 8.6.3 and I encounter the following issue during the test suite:

[...]
### Failure in: 2
test/Util.hs:10
test/Spec.hs:243:7: fieldALensManual === fieldALensType failed:
    LHS:
        fieldALensManual
        fieldALensManual
          = \ @ f $dFunctor_aqiQ f ds_dvpm ->
              case ds_dvpm of { MkRecord a b ->
              fmap $dFunctor_aqiQ (\ a' -> MkRecord a' b) (f a)
              }

    RHS:
        $s$fHasTypeas_$ctyped
        $s$fHasTypeas_$ctyped
          = \ @ f w4 w5 w6 ->
              case w4 of { C:Functor ww1 ww2 ->
              case w6 of { MkRecord g1 g2 ->
              ww1 (\ x1 -> MkRecord x1 g2) (w5 g1)
              }
              }

        fieldALensType
        fieldALensType = $s$fHasTypeas_$ctyped

### Failure in: 10
test/Util.hs:10
test/Spec.hs:251:7: sum1PrismManual === sum1PrismB failed:
    LHS:
        $wsum1PrismManual
        $wsum1PrismManual
          = \ @ p @ f ww_sDaV ww_sDb2 w_sDaO w_sDaP ->
              let {
                $dFunctor
                $dFunctor = $p1Applicative w_sDaO } in
              ww_sDaV
                (\ x ->
                   case x of wild_X7A {
                     __DEFAULT -> Left (pure w_sDaO wild_X7A);
                     B i -> Right i
                   })
                (\ ds1 ->
                   case ds1 of {
                     Left x -> x;
                     Right y -> fmap $dFunctor B y
                   })
                (ww_sDb2 w_sDaP)

        sum1PrismManual
        sum1PrismManual
          = \ @ p @ f w_sDaN w_sDaO w_sDaP ->
              case w_sDaN of { C:Choice ww_sDaS ww_sDb1 ww_sDb2 ->
              case ww_sDaS of
              { C:Profunctor ww_sDaV ww_sDaW ww_sDaX ww_sDaY ww_sDaZ ->
              $wsum1PrismManual ww_sDaV ww_sDb2 w_sDaO w_sDaP
              }
              }

    RHS:
        lvl_sEuq
        lvl_sEuq = \ v -> v

        lvl_sEvK
        lvl_sEvK = \ @ x x1 -> x1

        $dGSumAsConstructor_sxV7
        $dGSumAsConstructor_sxV7
          = \ @ x @ p $dChoice ->
              let {
                g
                g = dimap
                      ($p1Choice $dChoice)
                      (lvl_sEvK `cast` <Co:68>)
                      (lvl_sEuq `cast` <Co:50>) } in
              \ x1 ->
                case $dChoice of { C:Choice ww1 ww2 ww3 ->
                case ww1 of { C:Profunctor ww5 ww6 ww7 ww8 ww9 ->
                ww5 left2 left1 (ww3 (ww5 right2 right1 (ww3 (g x1))))
                }
                }

        lvl_sEwc
        lvl_sEwc = $dGSumAsConstructor_sxV7 $fChoiceMarket

        $cto
        $cto
          = \ @ x ds_dvue ->
              case ds_dvue `cast` <Co:98> of {
                L1 ds_dvug ->
                  case ds_dvug of {
                    L1 ds_dvuh -> A (ds_dvuh `cast` <Co:41>);
                    R1 ds_dvuk -> B (ds_dvuk `cast` <Co:41>)
                  };
                R1 ds_dvun ->
                  case ds_dvun of {
                    L1 ds_dvuo -> C (ds_dvuo `cast` <Co:41>);
                    R1 ds_dvur -> D (ds_dvur `cast` <Co:41>)
                  }
              }

        $cfrom_svT9
        $cfrom_svT9
          = \ @ x x ->
              case x of {
                A g1 -> L1 (L1 (g1 `cast` <Co:44>));
                B g1 -> L1 (R1 (g1 `cast` <Co:44>));
                C g1 -> R1 (L1 (g1 `cast` <Co:44>));
                D g1 -> R1 (R1 (g1 `cast` <Co:44>))
              }

        lvl_sEyc
        lvl_sEyc = lvl_sEwc idPrism

        sum1PrismB
        sum1PrismB
          = \ @ p @ f $dChoice $dApplicative eta_B1 ->
              let {
                $dFunctor
                $dFunctor = $p1Applicative $dApplicative } in
              case lvl_sEyc of { Market bt seta ->
              let {
                bt1
                bt1 = \ x -> $cto ((bt x) `cast` <Co:129>) } in
              dimap
                ($p1Choice $dChoice)
                (\ x ->
                   case seta ($cfrom_svT9 x) of {
                     Left x1 ->
                       Left
                         (pure
                            $dApplicative
                            (case x1 of {
                               L1 ds_dvug ->
                                 case ds_dvug of {
                                   L1 ds_dvuh -> A (ds_dvuh `cast` <Co:43>);
                                   R1 ds_dvuk -> B (ds_dvuk `cast` <Co:43>)
                                 };
                               R1 ds_dvun ->
                                 case ds_dvun of {
                                   L1 ds_dvuo -> C (ds_dvuo `cast` <Co:43>);
                                   R1 ds_dvur -> D (ds_dvur `cast` <Co:43>)
                                 }
                             }));
                     Right y -> Right y
                   })
                (\ ds1 ->
                   case ds1 of {
                     Left x -> x;
                     Right y -> fmap $dFunctor bt1 y
                   })
                (right' $dChoice eta_B1)
              }
[...]

This can be built using nix-build with this default.nix file at the root of the generic-lens repository:

with import (fetchTarball {
  url = https://github.com/NixOS/nixpkgs/archive/2a858b3f766.tar.gz;
  sha256 = "09wqkw2mdfb5crch6h15x51myhza6hx4l30mmr1sqns625h64xhc";
}) {};
haskellPackages.developPackage { root = ./.; }

The environment is composed of ghc 8.6.3 and the following packages:

    Cabal-2.4.0.1
    HUnit-1.6.0.0
    StateVar-1.1.1.1
    adjunctions-4.4
    array-0.5.3.0
    base-4.12.0.0
    base-compat-0.10.5
    base-orphans-0.8
    bifunctors-5.5.3
    binary-0.8.6.0
    bytestring-0.10.8.2
    call-stack-0.1.0
    code-page-0.2
    comonad-5.0.4
    containers-0.6.0.1
    contravariant-1.5
    deepseq-1.4.4.0
    directory-1.3.3.0
    distributive-0.6
    doctest-0.16.0.1
    exceptions-0.10.0
    filepath-1.4.2.1
    free-5.1
    ghc-8.6.3
    ghc-boot-8.6.3
    ghc-boot-th-8.6.3
    ghc-compact-0.1.0.0
    ghc-heap-8.6.3
    ghc-paths-0.1.0.9
    ghc-prim-0.5.3
    ghci-8.6.3
    hashable-1.2.7.0
    haskeline-0.7.4.3
    hpc-0.6.0.3
    inspection-testing-0.4.1.1
    integer-gmp-1.0.2.0
    invariant-0.5.1
    kan-extensions-5.2
    lens-4.17
    libiserv-8.6.3
    mtl-2.2.2
    parallel-3.2.2.0
    parsec-3.1.13.0
    pretty-1.1.3.6
    primitive-0.6.4.0
    process-1.6.3.0
    profunctors-5.3
    reflection-2.1.4
    rts-1.0
    semigroupoids-5.3.2
    semigroups-0.18.5
    stm-2.5.0.0
    syb-0.7
    tagged-0.8.6
    template-haskell-2.14.0.0
    terminfo-0.4.1.2
    text-1.2.3.1
    th-abstraction-0.2.10.0
    time-1.8.0.2
    transformers-0.5.5.0
    transformers-base-0.4.5.2
    transformers-compat-0.6.2
    unix-2.7.2.2
    unordered-containers-0.2.9.0
    vector-0.12.0.2
    void-0.7.2
    xhtml-3000.2.2.1

guibou avatar Jan 23 '19 22:01 guibou

Sorry, I just saw #65 which discuss the same issue.

guibou avatar Jan 23 '19 23:01 guibou

But that #65 issue is ancient, closed, and that topic theme was different.

Indeed - package fails its own tests.

I would now refer to *this issue in Nixpkgs.

Hi :wave: @guibou

Anton-Latukha avatar Jun 04 '20 21:06 Anton-Latukha