Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHC 9.0 compatibility #129

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.2.0.3
- Support for GHC 9.2

## 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.3
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, GHC == 9.2.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
1 change: 1 addition & 0 deletions src/Data/Generics/Product/Constraints.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
Expand Down
1 change: 1 addition & 0 deletions src/Data/Generics/Product/Fields.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
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
1 change: 1 addition & 0 deletions src/Data/Generics/Product/Internal/HList.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GADTs #-}
Expand Down
1 change: 1 addition & 0 deletions src/Data/Generics/Product/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
Expand Down
1 change: 1 addition & 0 deletions src/Data/Generics/Sum/Internal/Constructors.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE KindSignatures #-}
Expand Down