well-typed / optics

Optics as an abstract interface
375 stars 24 forks source link

optics-extra needs revision #406

Closed phadej closed 3 years ago

phadej commented 3 years ago
                     9.0.1  8.10.4  8.8.4  8.6.5  8.4.4  8.2.2  8.0.2  7.10.3  7.8.4  7.6.3  7.4.2  7.2.2  7.0.4
optics-extra-0.4     OK     OK      OK     OK     OK     OK     NO-IP  NO-IP   NO-IP  NO-IP  NO-IP  NO-IP  NO-IP
optics-extra-0.3     FAIL   OK      OK     OK     OK     OK     OK     NO-IP   NO-IP  NO-IP  NO-IP  NO-IP  NO-IP
[21 of 24] Compiling Optics.Passthrough ( src/Optics/Passthrough.hs, /codetmp/optics-extra-0.3/.dist-newstyle-trustee/7478053b63c7749120bdb218b82bd28e5baa489534f8f5f0c33963a252fbcb68c0691edc6325fe9e0cbfef710e6d0f4f3ea3cc9eea97da265794bfe1947cf16a/build/x86_64-linux/ghc-9.0.1/optics-extra-0.3/noopt/build/Optics/Passthrough.o, /codetmp/optics-extra-0.3/.dist-newstyle-trustee/7478053b63c7749120bdb218b82bd28e5baa489534f8f5f0c33963a252fbcb68c0691edc6325fe9e0cbfef710e6d0f4f3ea3cc9eea97da265794bfe1947cf16a/build/x86_64-linux/ghc-9.0.1/optics-extra-0.3/noopt/build/Optics/Passthrough.dyn_o )

src/Optics/Passthrough.hs:19:17: error:
    • Couldn't match type: forall (f :: * -> *).
                           Functor f =>
                           (a -> f b) -> s -> f t
                     with: (a -> (r, b)) -> s -> (r, t)
      Expected: Optic An_Iso is s t a b
                -> (a -> (r, b)) -> s -> (ViewResult An_Iso r, t)
        Actual: Optic An_Iso is s t a b -> LensVL s t a b
    • In the expression: toLensVL
      In an equation for ‘passthrough’: passthrough = toLensVL
      In the instance declaration for ‘PermeableOptic An_Iso r’
    • Relevant bindings include
        passthrough :: Optic An_Iso is s t a b
                       -> (a -> (r, b)) -> s -> (ViewResult An_Iso r, t)
          (bound at src/Optics/Passthrough.hs:19:3)
   |
19 |   passthrough = toLensVL
   |                 ^^^^^^^^

src/Optics/Passthrough.hs:23:17: error:
    • Couldn't match type: forall (f :: * -> *).
                           Functor f =>
                           (a -> f b) -> s -> f t
                     with: (a -> (r, b)) -> s -> (r, t)
      Expected: Optic A_Lens is s t a b
                -> (a -> (r, b)) -> s -> (ViewResult A_Lens r, t)
        Actual: Optic A_Lens is s t a b -> LensVL s t a b
    • In the expression: toLensVL
      In an equation for ‘passthrough’: passthrough = toLensVL
      In the instance declaration for ‘PermeableOptic A_Lens r’
    • Relevant bindings include
        passthrough :: Optic A_Lens is s t a b
                       -> (a -> (r, b)) -> s -> (ViewResult A_Lens r, t)
          (bound at src/Optics/Passthrough.hs:23:3)
   |
23 |   passthrough = toLensVL
   |                 ^^^^^^^^

Looks like we have base <5. (optics-core-0.3 works with GHC-9.0, fwiw).

adamgundry commented 3 years ago

@phadej Thanks for flagging that up, I've revised the base bounds for optics-extra-0.3 to >=4.9 && <4.15. That should transitively rule out optics-0.3 with GHC 9.0.

How are you producing that build matrix? I can only see older GHCs on https://matrix.hackage.haskell.org/

phadej commented 3 years ago

With https://github.com/phadej/trustee