Skip to content

Commit

Permalink
GHC 9.0 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
sheaf committed Jan 2, 2021
1 parent e4f6890 commit e2b4e7d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.2.0.2
- Support for GHC 9.0

## 1.2.0.1
- Give HasAny/AsAny the same VTA behavior on 8.6 and 8.8 (Ryan Scott)

Expand Down
4 changes: 2 additions & 2 deletions generic-lens.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: generic-lens
version: 1.2.0.1
version: 1.2.0.2
synopsis: Generically derive traversals, lenses and prisms.
description: This library uses GHC.Generics to derive efficient optics (traversals, lenses and prisms) for algebraic data types in a type-directed way, with a focus on good type inference and error messages when possible.

Expand All @@ -11,7 +11,7 @@ maintainer: [email protected]
category: Generics, Records, Lens
build-type: Simple
cabal-version: >= 1.10
Tested-With: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.1, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.1
Tested-With: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.1, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.1, GHC == 8.10.3, GHC == 9.0.1

extra-source-files: ChangeLog.md
, examples/StarWars.hs
Expand Down
4 changes: 2 additions & 2 deletions src/Data/Generics/Internal/Profunctor/Iso.hs
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ fromIso l = withIso l $ \ sa bt -> iso bt sa
{-# INLINE fromIso #-}

iso :: (s -> a) -> (b -> t) -> Iso s t a b
iso = dimap
iso sa bt = dimap sa bt
{-# INLINE iso #-}

iso2isovl :: Iso s t a b -> VL.Iso s t a b
iso2isovl _iso = withIso _iso VL.iso
iso2isovl _iso = withIso _iso $ \ sa bt -> VL.iso sa bt
{-# INLINE iso2isovl #-}

withIso :: Iso s t a b -> ((s -> a) -> (b -> t) -> r) -> r
Expand Down
8 changes: 4 additions & 4 deletions src/Data/Generics/Internal/Profunctor/Prism.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ match k = withPrism k $ \_ _match -> _match
-- Prism stuff

without' :: Prism s t a b -> Prism s t c d -> Prism s t (Either a c) (Either b d)
without' k =
withPrism k $ \bt _ k' ->
withPrism k' $ \dt setc ->
prism (either bt dt) $ \s -> fmap Right (setc s)
without' k p =
(withPrism k $ \bt _ k' ->
withPrism k' $ \dt setc ->
prism (either bt dt) $ \s -> fmap Right (setc s)) p
{-# INLINE without' #-}

withPrism :: APrism s t a b -> ((b -> t) -> (s -> Either t a) -> r) -> r
Expand Down
4 changes: 2 additions & 2 deletions src/Data/Generics/Product/Internal/Constraints.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ instance
gconstraints' f (R1 r) = R1 <$> gconstraints' @c f r

instance c a => GHasConstraints' c (Rec0 a) where
gconstraints' = kIso
gconstraints' f = kIso f

instance GHasConstraints' c f
=> GHasConstraints' c (M1 m meta f) where
Expand Down Expand Up @@ -98,7 +98,7 @@ instance GHasConstraints c V1 V1 where
gconstraints _ = pure

instance c a b => GHasConstraints c (Rec0 a) (Rec0 b) where
gconstraints = kIso
gconstraints f = kIso f

--------------------------------------------------------------------------------

Expand Down

0 comments on commit e2b4e7d

Please sign in to comment.