on master help sign in
Fix up .cabal file and build errors.
commit7da08cfe766b5f073ef4e22a9c9146354c326590 authorWill Jones <will@sacharissa.co.uk> dateMon 31 Jul 2017, 17:05 (9 years ago) parent4a424e1
2 files changed+65−133
generic-lens.cabal+60−127 src/Data/Generics/Product/Subtype.hs+5−6
generic-lens.cabal+60−127
@@ -1,144 +1,77 @@
1−name: generic-lens
2−
3−version: 0.3.0.0
4−
5−synopsis: Generic data-structure operations exposed as lenses.
6−
7−description: This package uses the GHC 8 Generic representation to derive various operations on data structures with a lens interface, including structural subtype relationship between records and positional indexing into arbitrary product types.
8−
9−homepage: https://github.com/kcsongor/generic-lens
10−
11−license: BSD3
12−
13−license-file: LICENSE
14−
15−author: Csongor Kiss
16−
17−maintainer: kiss.csongor.kiss@gmail.com
18−
19−category: Generics, Records, Lens
20−
21−build-type: Simple
22−
23−-- Extra files to be distributed with the package, such as examples or a
24−-- README.
25−extra-source-files: ChangeLog.md
26− , examples/StarWars.hs
27− , examples/Examples.hs
28− , README.md
29−
30−-- Constraint on the version of Cabal needed to build this package.
31−cabal-version: >= 1.10
32−
1+name: generic-lens
2+version: 0.3.0.0
3+synopsis: Generic data-structure operations exposed as lenses.
4+description: This package uses the GHC 8 Generic representation to derive various operations on data structures with a lens interface, including structural subtype relationship between records and positional indexing into arbitrary product types.
5+
6+homepage: https://github.com/kcsongor/generic-lens
7+license: BSD3
8+license-file: LICENSE
9+author: Csongor Kiss
10+maintainer: kiss.csongor.kiss@gmail.com
11+category: Generics, Records, Lens
12+build-type: Simple
13+cabal-version: >= 1.10
14+
15+extra-source-files: ChangeLog.md
16+ , examples/StarWars.hs
17+ , examples/Examples.hs
18+ , README.md
3319
3420library
35− exposed-modules: Data.Generics.Product
36− , Data.Generics.Product.Any
37− , Data.Generics.Product.Fields
38− , Data.Generics.Product.Positions
39− , Data.Generics.Product.Subtype
40− , Data.Generics.Product.Typed
41− , Data.Generics.Sum.Any
42− , Data.Generics.Sum.Constructors
43− , Data.Generics.Sum.Typed
44−
45− , Data.Generics.Record
46− , Data.Generics.Record.Subtype
47− , Data.Generics.Internal.Lens
48−
49− , Data.Generics.Internal.Lens
50−
51− other-modules: Data.Generics.Internal.Families
52− , Data.Generics.Internal.Families.Bool
53− , Data.Generics.Internal.Families.Count
54− , Data.Generics.Internal.Families.Has
55− , Data.Generics.Internal.HList
56−
57− other-extensions: AllowAmbiguousTypes
58− , DataKinds
59− , FlexibleInstances
60− , FunctionalDependencies
61− , PolyKinds
62− , Rank2Types
63− , ScopedTypeVariables
64− , TypeApplications
65− , TypeFamilies
66− , TypeOperators
67− , UndecidableInstances
68−
69− -- Other library packages from which modules are imported.
70− build-depends: base >= 4.9 && <= 5.0
71− , profunctors >= 5.0 && <= 6.0
72−
73− -- Directories containing source files.
74− hs-source-dirs: src
75−
76− -- Base language which the package is written in.
77− default-language: Haskell2010
78− ghc-options: -Wall
21+ exposed-modules: Data.Generics.Product
22+ , Data.Generics.Product.Any
23+ , Data.Generics.Product.Fields
24+ , Data.Generics.Product.Positions
25+ , Data.Generics.Product.Subtype
26+ , Data.Generics.Product.Typed
27+ , Data.Generics.Sum.Any
28+ , Data.Generics.Sum.Constructors
29+ , Data.Generics.Sum.Typed
30+
31+ , Data.Generics.Internal.Lens
32+
33+ other-modules: Data.Generics.Internal.Families
34+ , Data.Generics.Internal.Families.Bool
35+ , Data.Generics.Internal.Families.Count
36+ , Data.Generics.Internal.Families.Has
37+ , Data.Generics.Internal.HList
38+
39+ build-depends: base >= 4.9 && <= 5.0
40+ , profunctors >= 5.0 && <= 6.0
41+
42+ hs-source-dirs: src
43+ default-language: Haskell2010
44+ ghc-options: -Wall
7945
8046source-repository head
81− type: git
82− location: https://github.com/kcsongor/generic-lens
47+ type: git
48+ location: https://github.com/kcsongor/generic-lens
8349
8450test-suite generic-lens-test
85− type:
86− exitcode-stdio-1.0
87− hs-source-dirs:
88− test
89− main-is:
90− Spec.hs
51+ type: exitcode-stdio-1.0
52+ hs-source-dirs: test
53+ main-is: Spec.hs
9154
92− build-depends: base >= 4.9 && <= 5.0
93− , QuickCheck
94− , hspec
95− , generic-lens
55+ build-depends: base >= 4.9 && <= 5.0
56+ , QuickCheck
57+ , hspec
58+ , generic-lens
9659
97− ghc-options:
98− -Wall
99− other-extensions: AllowAmbiguousTypes
100− , DataKinds
101− , FlexibleInstances
102− , FunctionalDependencies
103− , PolyKinds
104− , Rank2Types
105− , ScopedTypeVariables
106− , TypeApplications
107− , TypeFamilies
108− , TypeOperators
109− , UndecidableInstances
110− default-language:
111− Haskell2010
60+ default-language: Haskell2010
61+ ghc-options: -Wall
11262
11363benchmark generic-lens-bench
114− type:
115− exitcode-stdio-1.0
116− hs-source-dirs:
117− benchmarks
118− main-is:
119− Bench.hs
64+ type: exitcode-stdio-1.0
65+ hs-source-dirs: benchmarks
66+ main-is: Bench.hs
12067
121− build-depends: generic-lens
68+ build-depends: generic-lens
12269
70+ , base >= 4.9 && <= 5.0
12371 , QuickCheck
124− , base
12572 , criterion
12673 , deepseq
12774 , lens
12875
129− ghc-options:
130− -Wall
131− other-extensions: AllowAmbiguousTypes
132− , DataKinds
133− , FlexibleInstances
134− , FunctionalDependencies
135− , PolyKinds
136− , Rank2Types
137− , ScopedTypeVariables
138− , TypeApplications
139− , TypeFamilies
140− , TypeOperators
141− , UndecidableInstances
142−
143− default-language:
144− Haskell2010
76+ default-language: Haskell2010
77+ ghc-options: -Wall
src/Data/Generics/Product/Subtype.hs+5−6
@@ -53,12 +53,11 @@ module Data.Generics.Product.Subtype
5353 ( Subtype (..)
5454 ) where
5555
56−import Data.Generics.Product.Fields
57−import Data.Generics.Internal.Families.Has (HasFieldP)
58−
56+import Data.Generics.Internal.Families
5957import Data.Generics.Internal.Lens
58+import Data.Generics.Product.Fields
6059
61−import Data.Kind (Type)
60+import Data.Kind
6261import GHC.Generics
6362
6463-- |Structural subtype relationship
@@ -139,10 +138,10 @@ instance (GSmash a sup, GSmash b sup) => GSmash (a :*: b) sup where
139138
140139instance
141140 ( leaf ~ (S1 ('MetaSel ('Just field) p f b) t)
142− , GSmashLeaf leaf sup (HasFieldP field sup)
141+ , GSmashLeaf leaf sup (HasTotalFieldP field sup)
143142 ) => GSmash (S1 ('MetaSel ('Just field) p f b) t) sup where
144143
145− gsmash = gsmashLeaf @_ @_ @(HasFieldP field sup)
144+ gsmash = gsmashLeaf @_ @_ @(HasTotalFieldP field sup)
146145
147146instance GSmash sub sup => GSmash (C1 c sub) sup where
148147 gsmash sup (M1 sub) = M1 (gsmash sup sub)