on c2edab5 help sign in
.github/FUNDING.ymldeleted−12
since splitsnapshots
unifiedsplit
@@ -1,12 +0,0 @@
1−# These are supported funding model platforms
2−
3−github: [kcsongor] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4−patreon: # Replace with a single Patreon username
5−open_collective: # Replace with a single Open Collective username
6−ko_fi: # Replace with a single Ko-fi username
7−tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8−community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9−liberapay: # Replace with a single Liberapay username
10−issuehunt: # Replace with a single IssueHunt username
11−otechie: # Replace with a single Otechie username
12−custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
.travis.yml+72−132
@@ -1,155 +1,95 @@
1# This Travis job script has been generated by a script via
1# This Travis job script has been generated by a script via
2#
2#
3−# haskell-ci '--config=cabal.haskell-ci' 'cabal.project'
3+# make_travis_yml_2.hs 'generic-lens.cabal'
4#
4#
5−# For more information, see https://github.com/haskell-CI/haskell-ci
5+# For more information, see https://github.com/hvr/multi-ghc-travis
6−#
7−# version: 0.5.20190908
8#
6#
9language: c
7language: c
10−dist: xenial
8+sudo: false
9+
11git:
10git:
12− # whether to recursively clone submodules
11+ submodules: false # whether to recursively clone submodules
13− submodules: false
12+
14cache:
13cache:
15 directories:
14 directories:
16 - $HOME/.cabal/packages
15 - $HOME/.cabal/packages
17 - $HOME/.cabal/store
16 - $HOME/.cabal/store
17+
18before_cache:
18before_cache:
19− - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
19+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
20 # remove files that are regenerated by 'cabal update'
20 # remove files that are regenerated by 'cabal update'
21− - rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.*
21+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
22− - rm -fv $CABALHOME/packages/hackage.haskell.org/*.json
22+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
23− - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
23+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
24− - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
24+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
25− - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
25+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
26− - rm -rfv $CABALHOME/packages/head.hackage
26+
27matrix:
27matrix:
28 include:
28 include:
29− - compiler: ghc-8.8.1
29+ - compiler: "ghc-8.0.2"
30+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
30− addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.8.1","cabal-install-3.0"]}}
31+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
31− - compiler: ghc-8.6.5
32+ - compiler: "ghc-8.2.1"
32− addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-3.0"]}}
33+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
33− - compiler: ghc-8.4.4
34− addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-3.0"]}}
34+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.1], sources: [hvr-ghc]}}
35− - compiler: ghc-8.4.1
36− addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.1","cabal-install-3.0"]}}
37− - compiler: ghc-8.2.2
35+ - compiler: "ghc-8.2.2"
38− addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.2.2","cabal-install-3.0"]}}
36+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
37+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.2], sources: [hvr-ghc]}}
39− - compiler: ghc-8.0.2
38+ - compiler: "ghc-8.4.1"
40− addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.0.2","cabal-install-3.0"]}}
39+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
40+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.4.1], sources: [hvr-ghc]}}
41+
41before_install:
42before_install:
42− - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
43+ - HC=${CC}
43− - WITHCOMPILER="-w $HC"
44− - HADDOCK=$(echo "/opt/$CC/bin/haddock" | sed 's/-/\//')
45− - HCPKG="$HC-pkg"
44+ - HCPKG=${HC/ghc/ghc-pkg}
46 - unset CC
45 - unset CC
47− - CABAL=/opt/ghc/bin/cabal
46+ - PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
48− - CABALHOME=$HOME/.cabal
47+
49− - export PATH="$CABALHOME/bin:$PATH"
50− - TOP=$(pwd)
51− - "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
52− - echo $HCNUMVER
53− - CABAL="$CABAL -vnormal+nowrap+markoutput"
54− - set -o pipefail
55− - |
56− echo 'function blue(s) { printf "\033[0;34m" s "\033[0m " }' >> .colorful.awk
57− echo 'BEGIN { state = "output"; }' >> .colorful.awk
58− echo '/^-----BEGIN CABAL OUTPUT-----$/ { state = "cabal" }' >> .colorful.awk
59− echo '/^-----END CABAL OUTPUT-----$/ { state = "output" }' >> .colorful.awk
60− echo '!/^(-----BEGIN CABAL OUTPUT-----|-----END CABAL OUTPUT-----)/ {' >> .colorful.awk
61− echo ' if (state == "cabal") {' >> .colorful.awk
62− echo ' print blue($0)' >> .colorful.awk
63− echo ' } else {' >> .colorful.awk
64− echo ' print $0' >> .colorful.awk
65− echo ' }' >> .colorful.awk
66− echo '}' >> .colorful.awk
67− - cat .colorful.awk
68− - |
69− color_cabal_output () {
70− awk -f $TOP/.colorful.awk
71− }
72− - echo text | color_cabal_output
73install:
48install:
74− - ${CABAL} --version
49+ - cabal --version
75 - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
50 - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
76− - TEST=--enable-tests
77− - if [ $HCNUMVER -ge 80600 ] ; then TEST=--disable-tests ; fi
78− - BENCH=--enable-benchmarks
51+ - BENCH=${BENCH---enable-benchmarks}
79− - if [ $HCNUMVER -ge 80800 ] ; then BENCH=--disable-benchmarks ; fi
52+ - TEST=${TEST---enable-tests}
80− - HEADHACKAGE=false
53+ - HADDOCK=${HADDOCK-true}
81− - rm -f $CABALHOME/config
54+ - INSTALLED=${INSTALLED-true}
82− - |
83− echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
84− echo "remote-build-reporting: anonymous" >> $CABALHOME/config
85− echo "write-ghc-environment-files: always" >> $CABALHOME/config
86− echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config
87− echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config
88− echo "world-file: $CABALHOME/world" >> $CABALHOME/config
89− echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config
90− echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config
91− echo "installdir: $CABALHOME/bin" >> $CABALHOME/config
92− echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config
93− echo "store-dir: $CABALHOME/store" >> $CABALHOME/config
94− echo "install-dirs user" >> $CABALHOME/config
95− echo " prefix: $CABALHOME" >> $CABALHOME/config
96− echo "repository hackage.haskell.org" >> $CABALHOME/config
97− echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
98− - |
99− echo "program-default-options" >> $CABALHOME/config
100− echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
101− - cat $CABALHOME/config
102− - rm -fv cabal.project cabal.project.local cabal.project.freeze
103− - travis_retry ${CABAL} v2-update -v
55+ - travis_retry cabal update -v
104− # Generate cabal.project
56+ - sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
105− - rm -rf cabal.project cabal.project.local cabal.project.freeze
106− - touch cabal.project
107− - |
108− echo "packages: ." >> cabal.project
57+ - rm -fv cabal.project.local
109− - |
58+ - "echo 'packages: .' > cabal.project"
110− - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(generic-lens)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
111− - cat cabal.project || true
112− - cat cabal.project.local || true
113− - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
59+ - if [ -f "./configure.ac" ]; then
114− - ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH} | color_cabal_output
60+ (cd "."; autoreconf -i);
61+ fi
115− - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
62+ - rm -f cabal.project.freeze
116− - rm cabal.project.freeze
63+ - cabal build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
117− - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all | color_cabal_output
118− - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all | color_cabal_output
64+ - cabal build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
119−script:
65+ - rm -rf "."/.ghc.environment.* "."/dist-newstyle
120 - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
66 - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
121− # Packaging...
67+
122− - ${CABAL} v2-sdist all | color_cabal_output
68+# Here starts the actual work to be performed for the package under test;
123− # Unpacking...
69+# any command which exits with a non-zero exit code causes the build to fail.
70+script:
71+ # test that source-distributions can be generated
72+ - (cd "."; cabal sdist)
124− - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
73+ - mv "."/dist-newstyle/sdist/generic-lens-*.tar.gz ${DISTDIR}/
125− - cd ${DISTDIR} || false
74+ - cd ${DISTDIR}
126− - find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
75+ - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
127− - find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \;
128− - PKGDIR_generic_lens="$(find . -maxdepth 1 -type d -regex '.*/generic-lens-[0-9.]*')"
129− # Generate cabal.project
130− - rm -rf cabal.project cabal.project.local cabal.project.freeze
131− - touch cabal.project
132− - |
133− echo "packages: ${PKGDIR_generic_lens}" >> cabal.project
76+ - "echo 'packages: generic-lens-*/*.cabal' > cabal.project"
134− - |
77+ - "echo 'write-ghc-environment-files: always' >> cabal.project"
135− - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(generic-lens)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
136− - cat cabal.project || true
137− - cat cabal.project.local || true
138− # Building...
139 # this builds all libraries and executables (without tests/benchmarks)
78 # this builds all libraries and executables (without tests/benchmarks)
140− - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output
79+ - cabal build -w ${HC} --disable-tests --disable-benchmarks all
141− # Building with tests and benchmarks...
80+
81+ # Build with installed constraints for packages in global-db
82+ - if $INSTALLED; then
83+ echo cabal build -w ${HC} --disable-tests --disable-benchmarks $(${HCPKG} list --global --simple-output --names-only | sed 's/\([a-zA-Z0-9-]\{1,\}\) */--constraint="\1 installed" /g') all | sh;
84+ else echo "Not building with installed constraints"; fi
85+
142 # build & run tests, build benchmarks
86 # build & run tests, build benchmarks
143− - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output
87+ - cabal build -w ${HC} ${TEST} ${BENCH} all
144− # Testing...
88+ - if [ "x$TEST" = "x--enable-tests" ]; then cabal test -w ${HC} ${TEST} all; fi
145− - if [ $HCNUMVER -lt 80600 ] ; then ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output ; fi
89+
146− # cabal check...
147− - (cd ${PKGDIR_generic_lens} && ${CABAL} -vnormal check)
148− # haddock...
90+ # haddock
149− - ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all | color_cabal_output
91+ - rm -rf ./dist-newstyle
150− # Building without installed constraints for packages in global-db...
92+ - if $HADDOCK; then cabal haddock -w ${HC} --disable-tests --disable-benchmarks all; else echo "Skipping haddock generation";fi
151− - rm -f cabal.project.local
152− - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output
153
93
154−# REGENDATA ["--config=cabal.haskell-ci","cabal.project"]
94+# REGENDATA ["generic-lens.cabal"]
155# EOF
95# EOF
ChangeLog.md−5
@@ -1,14 +1,9 @@
1−## 1.2.0.1
2−- Give HasAny/AsAny the same VTA behavior on 8.6 and 8.8 (Ryan Scott)
3−
4## 1.2.0.0
1## 1.2.0.0
5- Add `HasTypesUsing` and `HasTypesCustom` for custom traversals (Lysxia)
2- Add `HasTypesUsing` and `HasTypesCustom` for custom traversals (Lysxia)
6- Improve type errors when no Generic instance is defined
3- Improve type errors when no Generic instance is defined
7−- `types` now supports Text by default
8
4
9### Breaking API changes
5### Breaking API changes
10- `HasType` now includes a reflexive case so that every type 'contains' itself (Matt Parsons)
6- `HasType` now includes a reflexive case so that every type 'contains' itself (Matt Parsons)
11−- `AsSubtype` and `Subtype` now include a reflexive case so that every type is a subtype of itself
12
7
13## 1.1.0.0
8## 1.1.0.0
14- Fix regression in type inference for polymorphic optics
9- Fix regression in type inference for polymorphic optics
LICENSE+1−1
@@ -1,4 +1,4 @@
1−Copyright (c) 2019, Csongor Kiss
1+Copyright (c) 2018, Csongor Kiss
2
2
3All rights reserved.
3All rights reserved.
4
4
cabal.haskell-cideleted−5
@@ -1,5 +0,0 @@
1−-- inspection tests fail
2−tests: <8.6
3−
4−-- blocked on vector-th-unbox
5−benchmarks: <8.8
generic-lens.cabal+5−6
@@ -1,5 +1,5 @@
1name: generic-lens
1name: generic-lens
2−version: 1.2.0.1
2+version: 1.2.0.0
3synopsis: Generically derive traversals, lenses and prisms.
3synopsis: Generically derive traversals, lenses and prisms.
4description: 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.
4description: 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.
5
5
@@ -11,7 +11,7 @@ maintainer: kiss.csongor.kiss@gmail.com
11category: Generics, Records, Lens
11category: Generics, Records, Lens
12build-type: Simple
12build-type: Simple
13cabal-version: >= 1.10
13cabal-version: >= 1.10
14−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
14+Tested-With: GHC == 8.0.2, GHC == 8.2.1, GHC == 8.4.1, GHC == 8.4.3
15
15
16extra-source-files: ChangeLog.md
16extra-source-files: ChangeLog.md
17 , examples/StarWars.hs
17 , examples/StarWars.hs
@@ -70,10 +70,9 @@ library
70 , Data.Generics.Product.Internal.Constraints
70 , Data.Generics.Product.Internal.Constraints
71 , Data.Generics.Product.Internal.HList
71 , Data.Generics.Product.Internal.HList
72
72
73− build-depends: base >= 4.9 && < 5
73+ build-depends: base >= 4.9 && <= 5.0
74− , profunctors >= 5.0 && < 6.0
74+ , profunctors >= 5.0 && <= 6.0
75− , tagged >= 0.8 && < 1
75+ , tagged >= 0.8 && <= 0.9
76− , text >= 1.2 && < 1.3
77
76
78 hs-source-dirs: src
77 hs-source-dirs: src
79 default-language: Haskell2010
78 default-language: Haskell2010
src/Data/GenericLens/Internal.hs+1−16
@@ -1,7 +1,7 @@
1-----------------------------------------------------------------------------
1-----------------------------------------------------------------------------
2-- |
2-- |
3-- Module : Data.GenericLens.Internal
3-- Module : Data.GenericLens.Internal
4−-- Copyright : (C) 2019 Csongor Kiss
4+-- Copyright : (C) 2018 Csongor Kiss
5-- License : BSD3
5-- License : BSD3
6-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
6-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
7-- Stability : experimental
7-- Stability : experimental
@@ -29,14 +29,6 @@ module Data.GenericLens.Internal
29 , module Data.Generics.Product.Internal.Subtype
29 , module Data.Generics.Product.Internal.Subtype
30 , module Data.Generics.Product.Internal.Constraints
30 , module Data.Generics.Product.Internal.Constraints
31 , module Data.Generics.Product.Internal.HList
31 , module Data.Generics.Product.Internal.HList
32−
33− , module Data.Generics.Internal.GenericN
34−
35− -- * van Laarhoven optics
36− , module Data.Generics.Internal.VL.Iso
37− , module Data.Generics.Internal.VL.Lens
38− , module Data.Generics.Internal.VL.Prism
39− , module Data.Generics.Internal.VL.Traversal
40 ) where
32 ) where
41
33
42import Data.Generics.Internal.Families
34import Data.Generics.Internal.Families
@@ -55,10 +47,3 @@ import Data.Generics.Product.Internal.GLens
55import Data.Generics.Product.Internal.Subtype
47import Data.Generics.Product.Internal.Subtype
56import Data.Generics.Product.Internal.Constraints
48import Data.Generics.Product.Internal.Constraints
57import Data.Generics.Product.Internal.HList
49import Data.Generics.Product.Internal.HList
58−
59−import Data.Generics.Internal.GenericN
60−
61−import Data.Generics.Internal.VL.Iso
62−import Data.Generics.Internal.VL.Lens
63−import Data.Generics.Internal.VL.Prism
64−import Data.Generics.Internal.VL.Traversal
src/Data/Generics/Internal/Families.hs+1−1
@@ -9,7 +9,7 @@
9-----------------------------------------------------------------------------
9-----------------------------------------------------------------------------
10-- |
10-- |
11-- Module : Data.Generics.Internal.Families
11-- Module : Data.Generics.Internal.Families
12−-- Copyright : (C) 2019 Csongor Kiss
12+-- Copyright : (C) 2018 Csongor Kiss
13-- License : BSD3
13-- License : BSD3
14-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
14-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
15-- Stability : experimental
15-- Stability : experimental
src/Data/Generics/Internal/Families/Collect.hs+1−1
@@ -7,7 +7,7 @@
7-----------------------------------------------------------------------------
7-----------------------------------------------------------------------------
8-- |
8-- |
9-- Module : Data.Generics.Internal.Families.Collect
9-- Module : Data.Generics.Internal.Families.Collect
10−-- Copyright : (C) 2019 Csongor Kiss
10+-- Copyright : (C) 2018 Csongor Kiss
11-- License : BSD3
11-- License : BSD3
12-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
12-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
13-- Stability : experimental
13-- Stability : experimental
src/Data/Generics/Internal/Families/Has.hs+1−1
@@ -7,7 +7,7 @@
7-----------------------------------------------------------------------------
7-----------------------------------------------------------------------------
8-- |
8-- |
9-- Module : Data.Generics.Internal.Families.Has
9-- Module : Data.Generics.Internal.Families.Has
10−-- Copyright : (C) 2019 Csongor Kiss
10+-- Copyright : (C) 2018 Csongor Kiss
11-- License : BSD3
11-- License : BSD3
12-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
12-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
13-- Stability : experimental
13-- Stability : experimental
src/Data/Generics/Internal/GenericN.hs+2−3
@@ -1,4 +1,3 @@
1−{-# OPTIONS_HADDOCK hide #-}
2{-# LANGUAGE DataKinds #-}
1{-# LANGUAGE DataKinds #-}
3{-# LANGUAGE FlexibleContexts #-}
2{-# LANGUAGE FlexibleContexts #-}
4{-# LANGUAGE FlexibleInstances #-}
3{-# LANGUAGE FlexibleInstances #-}
@@ -12,9 +11,9 @@
12--------------------------------------------------------------------------------
11--------------------------------------------------------------------------------
13-- |
12-- |
14-- Module : Data.Generics.Internal.GenericN
13-- Module : Data.Generics.Internal.GenericN
15−-- Copyright : (C) 2019 Csongor Kiss
14+-- Copyright : (C) 2018 Csongor Kiss
16−-- License : BSD3
17-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
15-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
16+-- License : BSD3
18-- Stability : experimental
17-- Stability : experimental
19-- Portability : non-portable
18-- Portability : non-portable
20--
19--
src/Data/Generics/Internal/Profunctor/Iso.hs+1−2
@@ -1,4 +1,3 @@
1−{-# OPTIONS_HADDOCK hide #-}
2{-# LANGUAGE TupleSections #-}
1{-# LANGUAGE TupleSections #-}
3{-# LANGUAGE GADTs #-}
2{-# LANGUAGE GADTs #-}
4{-# LANGUAGE NoMonomorphismRestriction #-}
3{-# LANGUAGE NoMonomorphismRestriction #-}
@@ -11,7 +10,7 @@
11-----------------------------------------------------------------------------
10-----------------------------------------------------------------------------
12-- |
11-- |
13-- Module : Data.Generics.Internal.Profunctor.Iso
12-- Module : Data.Generics.Internal.Profunctor.Iso
14−-- Copyright : (C) 2019 Csongor Kiss
13+-- Copyright : (C) 2018 Csongor Kiss
15-- License : BSD3
14-- License : BSD3
16-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
15-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
17-- Stability : experimental
16-- Stability : experimental
src/Data/Generics/Internal/Profunctor/Lens.hs+1−2
@@ -1,4 +1,3 @@
1−{-# OPTIONS_HADDOCK hide #-}
2{-# LANGUAGE GADTs #-}
1{-# LANGUAGE GADTs #-}
3{-# LANGUAGE NoMonomorphismRestriction #-}
2{-# LANGUAGE NoMonomorphismRestriction #-}
4{-# LANGUAGE Rank2Types #-}
3{-# LANGUAGE Rank2Types #-}
@@ -11,7 +10,7 @@
11-----------------------------------------------------------------------------
10-----------------------------------------------------------------------------
12-- |
11-- |
13-- Module : Data.Generics.Internal.Profunctor.Lens
12-- Module : Data.Generics.Internal.Profunctor.Lens
14−-- Copyright : (C) 2019 Csongor Kiss
13+-- Copyright : (C) 2018 Csongor Kiss
15-- License : BSD3
14-- License : BSD3
16-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
15-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
17-- Stability : experimental
16-- Stability : experimental
src/Data/Generics/Internal/Profunctor/Prism.hs+1−2
@@ -1,4 +1,3 @@
1−{-# OPTIONS_HADDOCK hide #-}
2{-# LANGUAGE GADTs #-}
1{-# LANGUAGE GADTs #-}
3{-# LANGUAGE LambdaCase #-}
2{-# LANGUAGE LambdaCase #-}
4{-# LANGUAGE NoMonomorphismRestriction #-}
3{-# LANGUAGE NoMonomorphismRestriction #-}
@@ -11,7 +10,7 @@
11-----------------------------------------------------------------------------
10-----------------------------------------------------------------------------
12-- |
11-- |
13-- Module : Data.Generics.Internal.Profunctor.Prism
12-- Module : Data.Generics.Internal.Profunctor.Prism
14−-- Copyright : (C) 2019 Csongor Kiss
13+-- Copyright : (C) 2018 Csongor Kiss
15-- License : BSD3
14-- License : BSD3
16-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
15-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
17-- Stability : experimental
16-- Stability : experimental
src/Data/Generics/Internal/VL/Iso.hs+1−2
@@ -1,4 +1,3 @@
1−{-# OPTIONS_HADDOCK hide #-}
2{-# LANGUAGE GADTs #-}
1{-# LANGUAGE GADTs #-}
3{-# LANGUAGE NoMonomorphismRestriction #-}
2{-# LANGUAGE NoMonomorphismRestriction #-}
4{-# LANGUAGE Rank2Types #-}
3{-# LANGUAGE Rank2Types #-}
@@ -10,7 +9,7 @@
10-----------------------------------------------------------------------------
9-----------------------------------------------------------------------------
11-- |
10-- |
12-- Module : Data.Generics.Internal.VL.Iso
11-- Module : Data.Generics.Internal.VL.Iso
13−-- Copyright : (C) 2019 Csongor Kiss
12+-- Copyright : (C) 2018 Csongor Kiss
14-- License : BSD3
13-- License : BSD3
15-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
14-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
16-- Stability : experimental
15-- Stability : experimental
src/Data/Generics/Internal/VL/Lens.hs+1−2
@@ -1,4 +1,3 @@
1−{-# OPTIONS_HADDOCK hide #-}
2{-# LANGUAGE GADTs #-}
1{-# LANGUAGE GADTs #-}
3{-# LANGUAGE NoMonomorphismRestriction #-}
2{-# LANGUAGE NoMonomorphismRestriction #-}
4{-# LANGUAGE Rank2Types #-}
3{-# LANGUAGE Rank2Types #-}
@@ -11,7 +10,7 @@
11-----------------------------------------------------------------------------
10-----------------------------------------------------------------------------
12-- |
11-- |
13-- Module : Data.Generics.Internal.VL.Lens
12-- Module : Data.Generics.Internal.VL.Lens
14−-- Copyright : (C) 2019 Csongor Kiss
13+-- Copyright : (C) 2018 Csongor Kiss
15-- License : BSD3
14-- License : BSD3
16-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
15-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
17-- Stability : experimental
16-- Stability : experimental
src/Data/Generics/Internal/VL/Prism.hs+1−2
@@ -1,4 +1,3 @@
1−{-# OPTIONS_HADDOCK hide #-}
2{-# LANGUAGE GADTs #-}
1{-# LANGUAGE GADTs #-}
3{-# LANGUAGE NoMonomorphismRestriction #-}
2{-# LANGUAGE NoMonomorphismRestriction #-}
4{-# LANGUAGE Rank2Types #-}
3{-# LANGUAGE Rank2Types #-}
@@ -10,7 +9,7 @@
10-----------------------------------------------------------------------------
9-----------------------------------------------------------------------------
11-- |
10-- |
12-- Module : Data.Generics.Internal.VL.Prism
11-- Module : Data.Generics.Internal.VL.Prism
13−-- Copyright : (C) 2019 Csongor Kiss
12+-- Copyright : (C) 2018 Csongor Kiss
14-- License : BSD3
13-- License : BSD3
15-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
14-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
16-- Stability : experimental
15-- Stability : experimental
src/Data/Generics/Internal/VL/Traversal.hs+1−2
@@ -1,4 +1,3 @@
1−{-# OPTIONS_HADDOCK hide #-}
2{-# LANGUAGE AllowAmbiguousTypes #-}
1{-# LANGUAGE AllowAmbiguousTypes #-}
3{-# LANGUAGE ConstraintKinds #-}
2{-# LANGUAGE ConstraintKinds #-}
4{-# LANGUAGE GADTs #-}
3{-# LANGUAGE GADTs #-}
@@ -12,7 +11,7 @@
12-----------------------------------------------------------------------------
11-----------------------------------------------------------------------------
13-- |
12-- |
14-- Module : Data.Generics.Internal.VL.Traversal
13-- Module : Data.Generics.Internal.VL.Traversal
15−-- Copyright : (C) 2019 Csongor Kiss
14+-- Copyright : (C) 2018 Csongor Kiss
16-- License : BSD3
15-- License : BSD3
17-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
16-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
18-- Stability : experimental
17-- Stability : experimental
src/Data/Generics/Labels.hs+1−1
@@ -16,7 +16,7 @@
16--------------------------------------------------------------------------------
16--------------------------------------------------------------------------------
17-- |
17-- |
18-- Module : Data.Generics.Labels
18-- Module : Data.Generics.Labels
19−-- Copyright : (C) 2019 Csongor Kiss
19+-- Copyright : (C) 2018 Csongor Kiss
20-- License : BSD3
20-- License : BSD3
21-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
21-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
22-- Stability : experimental
22-- Stability : experimental
src/Data/Generics/Product.hs+1−1
@@ -1,7 +1,7 @@
1-----------------------------------------------------------------------------
1-----------------------------------------------------------------------------
2-- |
2-- |
3-- Module : Data.Generics.Product
3-- Module : Data.Generics.Product
4−-- Copyright : (C) 2019 Csongor Kiss
4+-- Copyright : (C) 2018 Csongor Kiss
5-- License : BSD3
5-- License : BSD3
6-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
6-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
7-- Stability : experimental
7-- Stability : experimental
src/Data/Generics/Product/Any.hs+2−2
@@ -12,7 +12,7 @@
12-----------------------------------------------------------------------------
12-----------------------------------------------------------------------------
13-- |
13-- |
14-- Module : Data.Generics.Product.Any
14-- Module : Data.Generics.Product.Any
15−-- Copyright : (C) 2019 Csongor Kiss
15+-- Copyright : (C) 2018 Csongor Kiss
16-- License : BSD3
16-- License : BSD3
17-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
17-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
18-- Stability : experimental
18-- Stability : experimental
@@ -53,7 +53,7 @@ import Data.Generics.Product.Typed
53-- human = Human "Tunyasz" 50 "London"
53-- human = Human "Tunyasz" 50 "London"
54-- :}
54-- :}
55
55
56−class HasAny sel s t a b | s sel -> a where
56+class HasAny (sel :: k) s t a b | s sel k -> a where
57 -- |A lens that focuses on a part of a product as identified by some
57 -- |A lens that focuses on a part of a product as identified by some
58 -- selector. Currently supported selectors are field names, positions and
58 -- selector. Currently supported selectors are field names, positions and
59 -- unique types. Compatible with the lens package's 'Control.Lens.Lens'
59 -- unique types. Compatible with the lens package's 'Control.Lens.Lens'
src/Data/Generics/Product/Constraints.hs+1−1
@@ -11,7 +11,7 @@
11-----------------------------------------------------------------------------
11-----------------------------------------------------------------------------
12-- |
12-- |
13-- Module : Data.Generics.Product.Constraints
13-- Module : Data.Generics.Product.Constraints
14−-- Copyright : (C) 2019 Csongor Kiss
14+-- Copyright : (C) 2018 Csongor Kiss
15-- License : BSD3
15-- License : BSD3
16-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
16-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
17-- Stability : experimental
17-- Stability : experimental
src/Data/Generics/Product/Fields.hs+2−11
@@ -16,7 +16,7 @@
16-----------------------------------------------------------------------------
16-----------------------------------------------------------------------------
17-- |
17-- |
18-- Module : Data.Generics.Product.Fields
18-- Module : Data.Generics.Product.Fields
19−-- Copyright : (C) 2019 Csongor Kiss
19+-- Copyright : (C) 2018 Csongor Kiss
20-- License : BSD3
20-- License : BSD3
21-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
21-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
22-- Stability : experimental
22-- Stability : experimental
@@ -175,16 +175,7 @@ instance -- see Note [Changing type parameters]
175 ) => HasField field s t a b where
175 ) => HasField field s t a b where
176 field f s = field0 @field f s
176 field f s = field0 @field f s
177
177
178−-- | See Note [Uncluttering type signatures]
178+-- -- See Note [Uncluttering type signatures]
179−#if __GLASGOW_HASKELL__ < 804
180−-- >>> :t field
181−-- field
182−-- :: (HasField field s t a b, Functor f) => (a -> f b) -> s -> f t
183−#else
184−-- >>> :t field
185−-- field
186−-- :: (Functor f, HasField field s t a b) => (a -> f b) -> s -> f t
187−#endif
188instance {-# OVERLAPPING #-} HasField f (Void1 a) (Void1 b) a b where
179instance {-# OVERLAPPING #-} HasField f (Void1 a) (Void1 b) a b where
189 field = undefined
180 field = undefined
190
181
src/Data/Generics/Product/HList.hs+1−1
@@ -10,7 +10,7 @@
10-----------------------------------------------------------------------------
10-----------------------------------------------------------------------------
11-- |
11-- |
12-- Module : Data.Generics.Product.HList
12-- Module : Data.Generics.Product.HList
13−-- Copyright : (C) 2019 Csongor Kiss
13+-- Copyright : (C) 2018 Csongor Kiss
14-- License : BSD3
14-- License : BSD3
15-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
15-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
16-- Stability : experimental
16-- Stability : experimental
src/Data/Generics/Product/Internal/Constraints.hs+1−1
@@ -15,7 +15,7 @@
15-----------------------------------------------------------------------------
15-----------------------------------------------------------------------------
16-- |
16-- |
17-- Module : Data.Generics.Product.Internal.Constraints
17-- Module : Data.Generics.Product.Internal.Constraints
18−-- Copyright : (C) 2019 Csongor Kiss
18+-- Copyright : (C) 2018 Csongor Kiss
19-- License : BSD3
19-- License : BSD3
20-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
20-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
21-- Stability : experimental
21-- Stability : experimental
src/Data/Generics/Product/Internal/GLens.hs+1−1
@@ -17,7 +17,7 @@
17-----------------------------------------------------------------------------
17-----------------------------------------------------------------------------
18-- |
18-- |
19-- Module : Data.Generics.Product.Internal.GLens
19-- Module : Data.Generics.Product.Internal.GLens
20−-- Copyright : (C) 2019 Csongor Kiss
20+-- Copyright : (C) 2018 Csongor Kiss
21-- License : BSD3
21-- License : BSD3
22-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
22-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
23-- Stability : experimental
23-- Stability : experimental
src/Data/Generics/Product/Internal/HList.hs+1−1
@@ -20,7 +20,7 @@
20-----------------------------------------------------------------------------
20-----------------------------------------------------------------------------
21-- |
21-- |
22-- Module : Data.Generics.Product.Internal.HList
22-- Module : Data.Generics.Product.Internal.HList
23−-- Copyright : (C) 2019 Csongor Kiss
23+-- Copyright : (C) 2018 Csongor Kiss
24-- License : BSD3
24-- License : BSD3
25-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
25-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
26-- Stability : experimental
26-- Stability : experimental
src/Data/Generics/Product/Internal/Positions.hs+1−1
@@ -17,7 +17,7 @@
17-----------------------------------------------------------------------------
17-----------------------------------------------------------------------------
18-- |
18-- |
19-- Module : Data.Generics.Product.Internal.Positions
19-- Module : Data.Generics.Product.Internal.Positions
20−-- Copyright : (C) 2019 Csongor Kiss
20+-- Copyright : (C) 2018 Csongor Kiss
21-- License : BSD3
21-- License : BSD3
22-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
22-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
23-- Stability : experimental
23-- Stability : experimental
src/Data/Generics/Product/Internal/Subtype.hs+1−1
@@ -16,7 +16,7 @@
16-----------------------------------------------------------------------------
16-----------------------------------------------------------------------------
17-- |
17-- |
18-- Module : Data.Generics.Product.Internal.Subtype
18-- Module : Data.Generics.Product.Internal.Subtype
19−-- Copyright : (C) 2019 Csongor Kiss
19+-- Copyright : (C) 2018 Csongor Kiss
20-- License : BSD3
20-- License : BSD3
21-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
21-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
22-- Stability : experimental
22-- Stability : experimental
src/Data/Generics/Product/Param.hs+1−1
@@ -15,7 +15,7 @@
15--------------------------------------------------------------------------------
15--------------------------------------------------------------------------------
16-- |
16-- |
17-- Module : Data.Generics.Product.Param
17-- Module : Data.Generics.Product.Param
18−-- Copyright : (C) 2019 Csongor Kiss
18+-- Copyright : (C) 2018 Csongor Kiss
19-- License : BSD3
19-- License : BSD3
20-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
20-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
21-- Stability : experimental
21-- Stability : experimental
src/Data/Generics/Product/Positions.hs+2−11
@@ -19,7 +19,7 @@
19-----------------------------------------------------------------------------
19-----------------------------------------------------------------------------
20-- |
20-- |
21-- Module : Data.Generics.Product.Positions
21-- Module : Data.Generics.Product.Positions
22−-- Copyright : (C) 2019 Csongor Kiss
22+-- Copyright : (C) 2018 Csongor Kiss
23-- License : BSD3
23-- License : BSD3
24-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
24-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
25-- Stability : experimental
25-- Stability : experimental
@@ -172,16 +172,7 @@ coerced :: forall s t s' t' x a b. (Coercible t t', Coercible s s')
172coerced = coerce
172coerced = coerce
173{-# INLINE coerced #-}
173{-# INLINE coerced #-}
174
174
175−-- | See Note [Uncluttering type signatures]
175+-- See Note [Uncluttering type signatures]
176−#if __GLASGOW_HASKELL__ < 804
177−-- >>> :t position
178−-- position
179−-- :: (HasPosition i s t a b, Functor f) => (a -> f b) -> s -> f t
180−#else
181−-- >>> :t position
182−-- position
183−-- :: (Functor f, HasPosition i s t a b) => (a -> f b) -> s -> f t
184−#endif
185instance {-# OVERLAPPING #-} HasPosition f (Void1 a) (Void1 b) a b where
176instance {-# OVERLAPPING #-} HasPosition f (Void1 a) (Void1 b) a b where
186 position = undefined
177 position = undefined
187
178
src/Data/Generics/Product/Subtype.hs+13−39
@@ -1,4 +1,3 @@
1−{-# LANGUAGE CPP #-}
2{-# LANGUAGE AllowAmbiguousTypes #-}
1{-# LANGUAGE AllowAmbiguousTypes #-}
3{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE DataKinds #-}
4{-# LANGUAGE FlexibleContexts #-}
3{-# LANGUAGE FlexibleContexts #-}
@@ -16,7 +15,7 @@
16-----------------------------------------------------------------------------
15-----------------------------------------------------------------------------
17-- |
16-- |
18-- Module : Data.Generics.Product.Subtype
17-- Module : Data.Generics.Product.Subtype
19−-- Copyright : (C) 2019 Csongor Kiss
18+-- Copyright : (C) 2018 Csongor Kiss
20-- License : BSD3
19-- License : BSD3
21-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
20-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
22-- Stability : experimental
21-- Stability : experimental
@@ -115,52 +114,27 @@ instance
115 , Generic b
114 , Generic b
116 , GSmash (Rep a) (Rep b)
115 , GSmash (Rep a) (Rep b)
117 , GUpcast (Rep a) (Rep b)
116 , GUpcast (Rep a) (Rep b)
118− , CustomError a b
117+ , ErrorUnless b a (CollectFieldsOrdered (Rep b) \\ CollectFieldsOrdered (Rep a))
118+ , Defined (Rep a)
119+ (NoGeneric a '[ 'Text "arising from a generic lens focusing on " ':<>: QuoteType b
120+ , 'Text "as a supertype of " ':<>: QuoteType a
121+ ])
122+ (() :: Constraint)
123+ , Defined (Rep b)
124+ (NoGeneric b '[ 'Text "arising from a generic lens focusing on " ':<>: QuoteType b
125+ , 'Text "as a supertype of " ':<>: QuoteType a
126+ ])
127+ (() :: Constraint)
119 ) => Subtype b a where
128 ) => Subtype b a where
120 smash p b = to $ gsmash (from p) (from b)
129 smash p b = to $ gsmash (from p) (from b)
121 upcast = to . gupcast . from
130 upcast = to . gupcast . from
122
131
123−type family CustomError a b :: Constraint where
124− CustomError a b =
125− ( ErrorUnless b a (CollectFieldsOrdered (Rep b) \\ CollectFieldsOrdered (Rep a))
126− , Defined (Rep a)
127− (NoGeneric a '[ 'Text "arising from a generic lens focusing on " ':<>: QuoteType b
128− , 'Text "as a supertype of " ':<>: QuoteType a
129− ])
130− (() :: Constraint)
131− , Defined (Rep b)
132− (NoGeneric b '[ 'Text "arising from a generic lens focusing on " ':<>: QuoteType b
133− , 'Text "as a supertype of " ':<>: QuoteType a
134− ])
135− (() :: Constraint)
136− )
137−
138instance {-# OVERLAPPING #-} Subtype a a where
132instance {-# OVERLAPPING #-} Subtype a a where
139 super = id
133 super = id
140
134
141−-- | See Note [Uncluttering type signatures]
135+-- See Note [Uncluttering type signatures]
142−#if __GLASGOW_HASKELL__ < 804
143−-- >>> :t super
144−-- super
145−-- :: (Subtype sup sub, Functor f) => (sup -> f sup) -> sub -> f sub
146−#else
147−-- >>> :t super
148−-- super
149−-- :: (Functor f, Subtype sup sub) => (sup -> f sup) -> sub -> f sub
150−#endif
151instance {-# OVERLAPPING #-} Subtype a Void where
136instance {-# OVERLAPPING #-} Subtype a Void where
152 super = undefined
137 super = undefined
153−
154−-- | See Note [Uncluttering type signatures]
155−#if __GLASGOW_HASKELL__ < 804
156−-- >>> :t super @Int
157−-- super @Int
158−-- :: (Subtype Int sub, Functor f) => (Int -> f Int) -> sub -> f sub
159−#else
160−-- >>> :t super @Int
161−-- super @Int
162−-- :: (Functor f, Subtype Int sub) => (Int -> f Int) -> sub -> f sub
163−#endif
164instance {-# OVERLAPPING #-} Subtype Void a where
138instance {-# OVERLAPPING #-} Subtype Void a where
165 super = undefined
139 super = undefined
166
140
src/Data/Generics/Product/Typed.hs+2−12
@@ -1,4 +1,3 @@
1−{-# LANGUAGE CPP #-}
2{-# LANGUAGE AllowAmbiguousTypes #-}
1{-# LANGUAGE AllowAmbiguousTypes #-}
3{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE DataKinds #-}
4{-# LANGUAGE FlexibleContexts #-}
3{-# LANGUAGE FlexibleContexts #-}
@@ -15,7 +14,7 @@
15-----------------------------------------------------------------------------
14-----------------------------------------------------------------------------
16-- |
15-- |
17-- Module : Data.Generics.Product.Typed
16-- Module : Data.Generics.Product.Typed
18−-- Copyright : (C) 2019 Csongor Kiss
17+-- Copyright : (C) 2018 Csongor Kiss
19-- License : BSD3
18-- License : BSD3
20-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
19-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
21-- Stability : experimental
20-- Stability : experimental
@@ -128,16 +127,7 @@ instance {-# OVERLAPPING #-} HasType a a where
128 setTyped a _ = a
127 setTyped a _ = a
129 {-# INLINE setTyped #-}
128 {-# INLINE setTyped #-}
130
129
131−-- | See Note [Uncluttering type signatures]
130+-- See Note [Uncluttering type signatures]
132−#if __GLASGOW_HASKELL__ < 804
133−-- >>> :t typed
134−-- typed :: (HasType a s, Functor f) => (a -> f a) -> s -> f s
135−#else
136−-- >>> :t typed
137−-- typed :: (Functor f, HasType a s) => (a -> f a) -> s -> f s
138−#endif
139−--
140−-- Note that this might not longer be needed given the above 'HasType a a' instance.
141instance {-# OVERLAPPING #-} HasType a Void where
131instance {-# OVERLAPPING #-} HasType a Void where
142 typed = undefined
132 typed = undefined
143
133
src/Data/Generics/Product/Types.hs+1−3
@@ -16,7 +16,7 @@
16-----------------------------------------------------------------------------
16-----------------------------------------------------------------------------
17-- |
17-- |
18-- Module : Data.Generics.Product.Types
18-- Module : Data.Generics.Product.Types
19−-- Copyright : (C) 2019 Csongor Kiss
19+-- Copyright : (C) 2018 Csongor Kiss
20-- License : BSD3
20-- License : BSD3
21-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
21-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
22-- Stability : experimental
22-- Stability : experimental
@@ -48,7 +48,6 @@ module Data.Generics.Product.Types
48import Data.Kind
48import Data.Kind
49import Data.Int (Int8, Int16, Int32, Int64)
49import Data.Int (Int8, Int16, Int32, Int64)
50import Data.Word (Word, Word8, Word16, Word32, Word64)
50import Data.Word (Word, Word8, Word16, Word32, Word64)
51−import qualified Data.Text as T
52
51
53import GHC.Generics
52import GHC.Generics
54import GHC.TypeLits
53import GHC.TypeLits
@@ -242,7 +241,6 @@ type family ChildrenDefault (a :: Type) :: [Type] where
242 ChildrenDefault Word16 = '[]
241 ChildrenDefault Word16 = '[]
243 ChildrenDefault Word32 = '[]
242 ChildrenDefault Word32 = '[]
244 ChildrenDefault Word64 = '[]
243 ChildrenDefault Word64 = '[]
245− ChildrenDefault T.Text = '[]
246 ChildrenDefault a
244 ChildrenDefault a
247 = Defined (Rep a)
245 = Defined (Rep a)
248 (NoGeneric a
246 (NoGeneric a
src/Data/Generics/Sum.hs+1−1
@@ -1,7 +1,7 @@
1-----------------------------------------------------------------------------
1-----------------------------------------------------------------------------
2-- |
2-- |
3-- Module : Data.Generics.Sum
3-- Module : Data.Generics.Sum
4−-- Copyright : (C) 2019 Csongor Kiss
4+-- Copyright : (C) 2018 Csongor Kiss
5-- License : BSD3
5-- License : BSD3
6-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
6-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
7-- Stability : experimental
7-- Stability : experimental
src/Data/Generics/Sum/Any.hs+2−2
@@ -11,7 +11,7 @@
11-----------------------------------------------------------------------------
11-----------------------------------------------------------------------------
12-- |
12-- |
13-- Module : Data.Generics.Sum.Any
13-- Module : Data.Generics.Sum.Any
14−-- Copyright : (C) 2019 Csongor Kiss
14+-- Copyright : (C) 2018 Csongor Kiss
15-- License : BSD3
15-- License : BSD3
16-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
16-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
17-- Stability : experimental
17-- Stability : experimental
@@ -61,7 +61,7 @@ import Data.Generics.Internal.VL.Prism
61-- :}
61-- :}
62
62
63-- |Sums that have generic prisms.
63-- |Sums that have generic prisms.
64−class AsAny sel a s | s sel -> a where
64+class AsAny (sel :: k) a s | s sel k -> a where
65 -- |A prism that projects a sum as identified by some selector. Currently
65 -- |A prism that projects a sum as identified by some selector. Currently
66 -- supported selectors are constructor names and unique types. Compatible
66 -- supported selectors are constructor names and unique types. Compatible
67 -- with the lens package's 'Control.Lens.Prism' type.
67 -- with the lens package's 'Control.Lens.Prism' type.
src/Data/Generics/Sum/Constructors.hs+2−15
@@ -15,7 +15,7 @@
15-----------------------------------------------------------------------------
15-----------------------------------------------------------------------------
16-- |
16-- |
17-- Module : Data.Generics.Sum.Constructors
17-- Module : Data.Generics.Sum.Constructors
18−-- Copyright : (C) 2019 Csongor Kiss
18+-- Copyright : (C) 2018 Csongor Kiss
19-- License : BSD3
19-- License : BSD3
20-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
20-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
21-- Stability : experimental
21-- Stability : experimental
@@ -152,20 +152,7 @@ instance
152 _Ctor = _Ctor0 @ctor
152 _Ctor = _Ctor0 @ctor
153 {-# INLINE[2] _Ctor #-}
153 {-# INLINE[2] _Ctor #-}
154
154
155−-- | See Note [Uncluttering type signatures]
155+-- See Note [Uncluttering type signatures]
156−#if __GLASGOW_HASKELL__ < 804
157−-- >>> :t _Ctor
158−-- _Ctor
159−-- :: (Applicative f, Data.Profunctor.Choice.Choice p,
160−-- AsConstructor ctor s t a b) =>
161−-- p a (f b) -> p s (f t)
162−#else
163−-- >>> :t _Ctor
164−-- _Ctor
165−-- :: (AsConstructor ctor s t a b, Data.Profunctor.Choice.Choice p,
166−-- Applicative f) =>
167−-- p a (f b) -> p s (f t)
168−#endif
169instance {-# OVERLAPPING #-} AsConstructor ctor (Void1 a) (Void1 b) a b where
156instance {-# OVERLAPPING #-} AsConstructor ctor (Void1 a) (Void1 b) a b where
170 _Ctor = undefined
157 _Ctor = undefined
171
158
src/Data/Generics/Sum/Internal/Constructors.hs+1−1
@@ -14,7 +14,7 @@
14-----------------------------------------------------------------------------
14-----------------------------------------------------------------------------
15-- |
15-- |
16-- Module : Data.Generics.Sum.Internal.Constructors
16-- Module : Data.Generics.Sum.Internal.Constructors
17−-- Copyright : (C) 2019 Csongor Kiss
17+-- Copyright : (C) 2018 Csongor Kiss
18-- License : BSD3
18-- License : BSD3
19-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
19-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
20-- Stability : experimental
20-- Stability : experimental
src/Data/Generics/Sum/Internal/Subtype.hs+1−1
@@ -14,7 +14,7 @@
14-----------------------------------------------------------------------------
14-----------------------------------------------------------------------------
15-- |
15-- |
16-- Module : Data.Generics.Sum.Internal.Subtype
16-- Module : Data.Generics.Sum.Internal.Subtype
17−-- Copyright : (C) 2019 Csongor Kiss
17+-- Copyright : (C) 2018 Csongor Kiss
18-- License : BSD3
18-- License : BSD3
19-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
19-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
20-- Stability : experimental
20-- Stability : experimental
src/Data/Generics/Sum/Internal/Typed.hs+1−1
@@ -13,7 +13,7 @@
13-----------------------------------------------------------------------------
13-----------------------------------------------------------------------------
14-- |
14-- |
15-- Module : Data.Generics.Sum.Internal.Typed
15-- Module : Data.Generics.Sum.Internal.Typed
16−-- Copyright : (C) 2019 Csongor Kiss
16+-- Copyright : (C) 2018 Csongor Kiss
17-- License : BSD3
17-- License : BSD3
18-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
18-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
19-- Stability : experimental
19-- Stability : experimental
src/Data/Generics/Sum/Subtype.hs+2−38
@@ -1,4 +1,3 @@
1−{-# LANGUAGE CPP #-}
2{-# LANGUAGE FlexibleContexts #-}
1{-# LANGUAGE FlexibleContexts #-}
3{-# LANGUAGE FlexibleInstances #-}
2{-# LANGUAGE FlexibleInstances #-}
4{-# LANGUAGE MonoLocalBinds #-}
3{-# LANGUAGE MonoLocalBinds #-}
@@ -12,7 +11,7 @@
12-----------------------------------------------------------------------------
11-----------------------------------------------------------------------------
13-- |
12-- |
14-- Module : Data.Generics.Sum.Subtype
13-- Module : Data.Generics.Sum.Subtype
15−-- Copyright : (C) 2019 Csongor Kiss
14+-- Copyright : (C) 2018 Csongor Kiss
16-- License : BSD3
15-- License : BSD3
17-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
16-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
18-- Stability : experimental
17-- Stability : experimental
@@ -114,45 +113,10 @@ instance
114 _Sub f = prismRavel (repIso . _GSub . fromIso repIso) f
113 _Sub f = prismRavel (repIso . _GSub . fromIso repIso) f
115 {-# INLINE[2] _Sub #-}
114 {-# INLINE[2] _Sub #-}
116
115
117−-- | Reflexive case
118−-- >>> _Sub # dog :: Animal
119−-- Dog (MkDog {name = "Shep", age = 3})
120−instance {-# OVERLAPPING #-} AsSubtype a a where
121− _Sub = id
122− {-# INLINE[2] _Sub #-}
123−
124−-- | See Note [Uncluttering type signatures]
116+-- See Note [Uncluttering type signatures]
125−#if __GLASGOW_HASKELL__ < 804
126−-- >>> :t _Sub
127−--_Sub
128−-- :: (Applicative f, Data.Profunctor.Choice.Choice p,
129−-- AsSubtype sub sup) =>
130−-- p sub (f sub) -> p sup (f sup)
131−-- >>> :t _Sub
132−#else
133−--_Sub
134−-- :: (AsSubtype sub sup, Data.Profunctor.Choice.Choice p,
135−-- Applicative f) =>
136−-- p sub (f sub) -> p sup (f sup)
137−#endif
138instance {-# OVERLAPPING #-} AsSubtype a Void where
117instance {-# OVERLAPPING #-} AsSubtype a Void where
139 injectSub = undefined
118 injectSub = undefined
140 projectSub = undefined
119 projectSub = undefined
141−
142−-- | See Note [Uncluttering type signatures]
143−#if __GLASGOW_HASKELL__ < 804
144−-- >>> :t _Sub @Int
145−-- _Sub @Int
146−-- :: (Applicative f, Data.Profunctor.Choice.Choice p,
147−-- AsSubtype Int sup) =>
148−-- p Int (f Int) -> p sup (f sup)
149−#else
150−-- >>> :t _Sub @Int
151−-- _Sub @Int
152−-- :: (AsSubtype Int sup, Data.Profunctor.Choice.Choice p,
153−-- Applicative f) =>
154−-- p Int (f Int) -> p sup (f sup)
155−#endif
156instance {-# OVERLAPPING #-} AsSubtype Void a where
120instance {-# OVERLAPPING #-} AsSubtype Void a where
157 injectSub = undefined
121 injectSub = undefined
158 projectSub = undefined
122 projectSub = undefined
src/Data/Generics/Sum/Typed.hs+2−29
@@ -1,4 +1,3 @@
1−{-# LANGUAGE CPP #-}
2{-# LANGUAGE TypeApplications #-}
1{-# LANGUAGE TypeApplications #-}
3{-# LANGUAGE AllowAmbiguousTypes #-}
2{-# LANGUAGE AllowAmbiguousTypes #-}
4{-# LANGUAGE DataKinds #-}
3{-# LANGUAGE DataKinds #-}
@@ -14,7 +13,7 @@
14-----------------------------------------------------------------------------
13-----------------------------------------------------------------------------
15-- |
14-- |
16-- Module : Data.Generics.Sum.Typed
15-- Module : Data.Generics.Sum.Typed
17−-- Copyright : (C) 2019 Csongor Kiss
16+-- Copyright : (C) 2018 Csongor Kiss
18-- License : BSD3
17-- License : BSD3
19-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
18-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
20-- Stability : experimental
19-- Stability : experimental
@@ -119,37 +118,11 @@ instance
119 _Typed eta = prismRavel (prismPRavel (repIso . _GTyped @_ @as . tupled)) eta
118 _Typed eta = prismRavel (prismPRavel (repIso . _GTyped @_ @as . tupled)) eta
120 {-# INLINE[2] _Typed #-}
119 {-# INLINE[2] _Typed #-}
121
120
122−-- | See Note [Uncluttering type signatures]
121+-- See Note [Uncluttering type signatures]
123−#if __GLASGOW_HASKELL__ < 804
124−-- >>> :t _Typed
125−-- _Typed
126−-- :: (Applicative f, Data.Profunctor.Choice.Choice p, AsType a s) =>
127−-- p a (f a) -> p s (f s)
128−#else
129−-- >>> :t _Typed
130−-- _Typed
131−-- :: (AsType a s, Data.Profunctor.Choice.Choice p, Applicative f) =>
132−-- p a (f a) -> p s (f s)
133−#endif
134instance {-# OVERLAPPING #-} AsType a Void where
122instance {-# OVERLAPPING #-} AsType a Void where
135 _Typed = undefined
123 _Typed = undefined
136 injectTyped = undefined
124 injectTyped = undefined
137 projectTyped = undefined
125 projectTyped = undefined
138−
139−-- | See Note [Uncluttering type signatures]
140−#if __GLASGOW_HASKELL__ < 804
141−-- >>> :t _Typed @Int
142−-- _Typed @Int
143−-- :: (Applicative f, Data.Profunctor.Choice.Choice p,
144−-- AsType Int s) =>
145−-- p Int (f Int) -> p s (f s)
146−#else
147−-- >>> :t _Typed @Int
148−-- _Typed @Int
149−-- :: (AsType Int s, Data.Profunctor.Choice.Choice p,
150−-- Applicative f) =>
151−-- p Int (f Int) -> p s (f s)
152−#endif
153instance {-# OVERLAPPING #-} AsType Void a where
126instance {-# OVERLAPPING #-} AsType Void a where
154 _Typed = undefined
127 _Typed = undefined
155 injectTyped = undefined
128 injectTyped = undefined
src/Data/Generics/Wrapped.hs+1−1
@@ -14,7 +14,7 @@
14-----------------------------------------------------------------------------
14-----------------------------------------------------------------------------
15-- |
15-- |
16-- Module : Data.Generics.Wrapped
16-- Module : Data.Generics.Wrapped
17−-- Copyright : (C) 2019 Csongor Kiss
17+-- Copyright : (C) 2018 Csongor Kiss
18-- License : BSD3
18-- License : BSD3
19-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
19-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
20-- Stability : experimental
20-- Stability : experimental