on master help sign in
HLint
72d03a2Csongor Kiss
src/Data/Generics/Internal/Families.hs+1−1
@@ -3,7 +3,6 @@
3{-# LANGUAGE FlexibleInstances #-}
3{-# LANGUAGE FlexibleInstances #-}
4{-# LANGUAGE KindSignatures #-}
4{-# LANGUAGE KindSignatures #-}
5{-# LANGUAGE MultiParamTypeClasses #-}
5{-# LANGUAGE MultiParamTypeClasses #-}
6−{-# LANGUAGE TypeApplications #-}
7{-# LANGUAGE TypeFamilies #-}
6{-# LANGUAGE TypeFamilies #-}
8{-# LANGUAGE TypeOperators #-}
7{-# LANGUAGE TypeOperators #-}
9
8
@@ -28,6 +27,7 @@ import Data.Generics.Internal.Families.Changing as Families
28
27
29import GHC.TypeLits (ErrorMessage (..), Symbol)
28import GHC.TypeLits (ErrorMessage (..), Symbol)
30
29
30+-- * Stuff
31type family ShowSymbols (ctors :: [Symbol]) :: ErrorMessage where
31type family ShowSymbols (ctors :: [Symbol]) :: ErrorMessage where
32 ShowSymbols '[]
32 ShowSymbols '[]
33 = 'Text ""
33 = 'Text ""
src/Data/Generics/Internal/Families/Changing.hs−1
@@ -1,7 +1,6 @@
1{-# LANGUAGE AllowAmbiguousTypes #-}
1{-# LANGUAGE AllowAmbiguousTypes #-}
2{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE DataKinds #-}
3{-# LANGUAGE FlexibleInstances #-}
3{-# LANGUAGE FlexibleInstances #-}
4−{-# LANGUAGE FunctionalDependencies #-}
5{-# LANGUAGE GADTs #-}
4{-# LANGUAGE GADTs #-}
6{-# LANGUAGE PolyKinds #-}
5{-# LANGUAGE PolyKinds #-}
7{-# LANGUAGE TypeFamilies #-}
6{-# LANGUAGE TypeFamilies #-}
src/Data/Generics/Internal/Profunctor/Iso.hs+4−6
@@ -1,9 +1,7 @@
1{-# LANGUAGE GADTs #-}
1{-# LANGUAGE GADTs #-}
2−{-# LANGUAGE LambdaCase #-}
3{-# LANGUAGE NoMonomorphismRestriction #-}
2{-# LANGUAGE NoMonomorphismRestriction #-}
4{-# LANGUAGE Rank2Types #-}
3{-# LANGUAGE Rank2Types #-}
5{-# LANGUAGE ScopedTypeVariables #-}
4{-# LANGUAGE ScopedTypeVariables #-}
6−{-# LANGUAGE TupleSections #-}
7{-# LANGUAGE TypeFamilies #-}
5{-# LANGUAGE TypeFamilies #-}
8{-# LANGUAGE TypeFamilyDependencies #-}
6{-# LANGUAGE TypeFamilyDependencies #-}
9{-# LANGUAGE TypeOperators #-}
7{-# LANGUAGE TypeOperators #-}
@@ -48,10 +46,10 @@ kIso = iso unK1 K1
48
46
49sumIso :: Iso ((a :+: b) x) ((a' :+: b') x) (Either (a x) (b x)) (Either (a' x) (b' x))
47sumIso :: Iso ((a :+: b) x) ((a' :+: b') x) (Either (a x) (b x)) (Either (a' x) (b' x))
50sumIso = iso back forth
48sumIso = iso back forth
51− where forth (Left l) = (L1 l)
49+ where forth (Left l) = L1 l
52− forth (Right r) = (R1 r)
50+ forth (Right r) = R1 r
53− back (L1 l) = (Left l)
51+ back (L1 l) = Left l
54− back (R1 r) = (Right r)
52+ back (R1 r) = Right r
55
53
56prodIso :: Iso ((a :*: b) x) ((a' :*: b') x) (a x, b x) (a' x, b' x)
54prodIso :: Iso ((a :*: b) x) ((a' :*: b') x) (a x, b x) (a' x, b' x)
57prodIso = iso (\(a :*: b) -> (a, b)) (\(a, b) -> (a :*: b))
55prodIso = iso (\(a :*: b) -> (a, b)) (\(a, b) -> (a :*: b))
src/Data/Generics/Internal/Profunctor/Lens.hs+2−3
@@ -1,5 +1,4 @@
1{-# LANGUAGE GADTs #-}
1{-# LANGUAGE GADTs #-}
2−{-# LANGUAGE LambdaCase #-}
3{-# LANGUAGE NoMonomorphismRestriction #-}
2{-# LANGUAGE NoMonomorphismRestriction #-}
4{-# LANGUAGE Rank2Types #-}
3{-# LANGUAGE Rank2Types #-}
5{-# LANGUAGE ScopedTypeVariables #-}
4{-# LANGUAGE ScopedTypeVariables #-}
@@ -74,12 +73,12 @@ build p = unTagged . p . Tagged
74-- | Lens focusing on the first element of a product
73-- | Lens focusing on the first element of a product
75first :: Lens ((a :*: b) x) ((a' :*: b) x) (a x) (a' x)
74first :: Lens ((a :*: b) x) ((a' :*: b) x) (a x) (a' x)
76first
75first
77− = lens (\(a :*: _) -> a) (\((_ :*: b), a') -> a' :*: b)
76+ = lens (\(a :*: _) -> a) (\(_ :*: b, a') -> a' :*: b)
78
77
79-- | Lens focusing on the second element of a product
78-- | Lens focusing on the second element of a product
80second :: Lens ((a :*: b) x) ((a :*: b') x) (b x) (b' x)
79second :: Lens ((a :*: b) x) ((a :*: b') x) (b x) (b' x)
81second
80second
82− = lens (\(_ :*: b) -> b) (\((a :*: _), b') -> a :*: b')
81+ = lens (\(_ :*: b) -> b) (\(a :*: _, b') -> a :*: b')
83
82
84fork :: (a -> b) -> (a -> c) -> a -> (b, c)
83fork :: (a -> b) -> (a -> c) -> a -> (b, c)
85fork f g a = (f a, g a)
84fork f g a = (f a, g a)
src/Data/Generics/Internal/Profunctor/Prism.hs+1−2
@@ -3,7 +3,6 @@
3{-# LANGUAGE NoMonomorphismRestriction #-}
3{-# LANGUAGE NoMonomorphismRestriction #-}
4{-# LANGUAGE Rank2Types #-}
4{-# LANGUAGE Rank2Types #-}
5{-# LANGUAGE ScopedTypeVariables #-}
5{-# LANGUAGE ScopedTypeVariables #-}
6−{-# LANGUAGE TupleSections #-}
7{-# LANGUAGE TypeFamilies #-}
6{-# LANGUAGE TypeFamilies #-}
8{-# LANGUAGE TypeFamilyDependencies #-}
7{-# LANGUAGE TypeFamilyDependencies #-}
9{-# LANGUAGE TypeOperators #-}
8{-# LANGUAGE TypeOperators #-}
@@ -106,7 +105,7 @@ instance Profunctor (Market a b) where
106 {-# INLINE ( .# ) #-}
105 {-# INLINE ( .# ) #-}
107
106
108instance Choice (Market a b) where
107instance Choice (Market a b) where
109− left' (Market bt seta) = Market (Left . bt) $ \sc -> case sc of
108+ left' (Market bt seta) = Market (Left . bt) $ \case
110 Left s -> case seta s of
109 Left s -> case seta s of
111 Left t -> Left (Left t)
110 Left t -> Left (Left t)
112 Right a -> Right a
111 Right a -> Right a
src/Data/Generics/Internal/VL/Iso.hs−2
@@ -1,9 +1,7 @@
1{-# LANGUAGE GADTs #-}
1{-# LANGUAGE GADTs #-}
2−{-# LANGUAGE LambdaCase #-}
3{-# LANGUAGE NoMonomorphismRestriction #-}
2{-# LANGUAGE NoMonomorphismRestriction #-}
4{-# LANGUAGE Rank2Types #-}
3{-# LANGUAGE Rank2Types #-}
5{-# LANGUAGE ScopedTypeVariables #-}
4{-# LANGUAGE ScopedTypeVariables #-}
6−{-# LANGUAGE TupleSections #-}
7{-# LANGUAGE TypeFamilies #-}
5{-# LANGUAGE TypeFamilies #-}
8{-# LANGUAGE TypeFamilyDependencies #-}
6{-# LANGUAGE TypeFamilyDependencies #-}
9{-# LANGUAGE TypeOperators #-}
7{-# LANGUAGE TypeOperators #-}
src/Data/Generics/Internal/VL/Lens.hs+1−3
@@ -1,9 +1,7 @@
1{-# LANGUAGE GADTs #-}
1{-# LANGUAGE GADTs #-}
2−{-# LANGUAGE LambdaCase #-}
3{-# LANGUAGE NoMonomorphismRestriction #-}
2{-# LANGUAGE NoMonomorphismRestriction #-}
4{-# LANGUAGE Rank2Types #-}
3{-# LANGUAGE Rank2Types #-}
5{-# LANGUAGE ScopedTypeVariables #-}
4{-# LANGUAGE ScopedTypeVariables #-}
6−{-# LANGUAGE TupleSections #-}
7{-# LANGUAGE TypeFamilies #-}
5{-# LANGUAGE TypeFamilies #-}
8{-# LANGUAGE TypeFamilyDependencies #-}
6{-# LANGUAGE TypeFamilyDependencies #-}
9{-# LANGUAGE TypeOperators #-}
7{-# LANGUAGE TypeOperators #-}
@@ -37,7 +35,7 @@ view :: ((a -> Const a a) -> s -> Const a s) -> s -> a
37view l s = (^.) s l
35view l s = (^.) s l
38
36
39set :: Lens s t a b -> b -> s -> t
37set :: Lens s t a b -> b -> s -> t
40−set l x = runIdentity . (l (Identity . const x))
38+set l x = runIdentity . l (Identity . const x)
41
39
42lens2lensvl :: ALens a b s t -> Lens s t a b
40lens2lensvl :: ALens a b s t -> Lens s t a b
43lens2lensvl (ALens _get _set) = lens _get _set
41lens2lensvl (ALens _get _set) = lens _get _set
src/Data/Generics/Internal/VL/Prism.hs−2
@@ -1,9 +1,7 @@
1{-# LANGUAGE GADTs #-}
1{-# LANGUAGE GADTs #-}
2−{-# LANGUAGE LambdaCase #-}
3{-# LANGUAGE NoMonomorphismRestriction #-}
2{-# LANGUAGE NoMonomorphismRestriction #-}
4{-# LANGUAGE Rank2Types #-}
3{-# LANGUAGE Rank2Types #-}
5{-# LANGUAGE ScopedTypeVariables #-}
4{-# LANGUAGE ScopedTypeVariables #-}
6−{-# LANGUAGE TupleSections #-}
7{-# LANGUAGE TypeFamilies #-}
5{-# LANGUAGE TypeFamilies #-}
8{-# LANGUAGE TypeFamilyDependencies #-}
6{-# LANGUAGE TypeFamilyDependencies #-}
9{-# LANGUAGE TypeOperators #-}
7{-# LANGUAGE TypeOperators #-}
src/Data/Generics/Internal/VL/Traversal.hs−2
@@ -1,9 +1,7 @@
1{-# LANGUAGE GADTs #-}
1{-# LANGUAGE GADTs #-}
2−{-# LANGUAGE LambdaCase #-}
3{-# LANGUAGE NoMonomorphismRestriction #-}
2{-# LANGUAGE NoMonomorphismRestriction #-}
4{-# LANGUAGE Rank2Types #-}
3{-# LANGUAGE Rank2Types #-}
5{-# LANGUAGE ScopedTypeVariables #-}
4{-# LANGUAGE ScopedTypeVariables #-}
6−{-# LANGUAGE TupleSections #-}
7{-# LANGUAGE TypeFamilies #-}
5{-# LANGUAGE TypeFamilies #-}
8{-# LANGUAGE TypeFamilyDependencies #-}
6{-# LANGUAGE TypeFamilyDependencies #-}
9{-# LANGUAGE TypeOperators #-}
7{-# LANGUAGE TypeOperators #-}
src/Data/Generics/Product/Internal/Keyed.hs+1−2
@@ -4,7 +4,6 @@
4{-# LANGUAGE FunctionalDependencies #-}
4{-# LANGUAGE FunctionalDependencies #-}
5{-# LANGUAGE GADTs #-}
5{-# LANGUAGE GADTs #-}
6{-# LANGUAGE ScopedTypeVariables #-}
6{-# LANGUAGE ScopedTypeVariables #-}
7−{-# LANGUAGE TupleSections #-}
8{-# LANGUAGE TypeApplications #-}
7{-# LANGUAGE TypeApplications #-}
9{-# LANGUAGE TypeFamilies #-}
8{-# LANGUAGE TypeFamilies #-}
10{-# LANGUAGE TypeInType #-}
9{-# LANGUAGE TypeInType #-}
@@ -50,5 +49,5 @@ instance
50 , IndexList i as bs a b
49 , IndexList i as bs a b
51 , GIsList k f g as bs
50 , GIsList k f g as bs
52 ) => GHasKey (key :: k) (M1 C meta f) (M1 C meta g) a b where
51 ) => GHasKey (key :: k) (M1 C meta f) (M1 C meta g) a b where
53− gkey = mIso . (glist @k) . point @i
52+ gkey = mIso . glist @k . point @i
54
53
src/Data/Generics/Product/Internal/List.hs+2−4
@@ -38,8 +38,6 @@ module Data.Generics.Product.Internal.List
38 , Elem
38 , Elem
39 , ListTuple (..)
39 , ListTuple (..)
40 , TupleToList
40 , TupleToList
41− , Permuting (..)
42− , Appending (..)
43 ) where
41 ) where
44
42
45import GHC.TypeLits
43import GHC.TypeLits
@@ -160,7 +158,7 @@ instance Permuting List '[] '[] where
160
158
161instance (Permuting List as as', Inserting List '(fa, a) as' bs')
159instance (Permuting List as as', Inserting List '(fa, a) as' bs')
162 => Permuting List ('(fa, a) ': as) bs' where
160 => Permuting List ('(fa, a) ': as) bs' where
163− permuting = fromIso consing . pairing id permuting . consing . (inserting @_ @'(fa, _))
161+ permuting = fromIso consing . pairing id permuting . consing . inserting @_ @'(fa, _)
164
162
165--------------------------------------------------------------------------------
163--------------------------------------------------------------------------------
166class IndexList (i :: Nat) as bs a b | i as -> a, i bs -> b, i as b -> bs, i bs a -> as where
164class IndexList (i :: Nat) as bs a b | i as -> a, i bs -> b, i as b -> bs, i bs a -> as where
@@ -170,7 +168,7 @@ instance {-# OVERLAPPING #-}
170 ( as ~ ('(f, a) ': as')
168 ( as ~ ('(f, a) ': as')
171 , bs ~ ('(f, b) ': as')
169 , bs ~ ('(f, b) ': as')
172 ) => IndexList 0 as bs a b where
170 ) => IndexList 0 as bs a b where
173− point = lens (\(x :> _) -> x) (\((_ :> xs), x') -> x' :> xs)
171+ point = lens (\(x :> _) -> x) (\(_ :> xs, x') -> x' :> xs)
174 {-# INLINE point #-}
172 {-# INLINE point #-}
175
173
176instance
174instance
src/Data/Generics/Product/Internal/Positions.hs+1−1
@@ -58,7 +58,7 @@ instance
58 ( IndexList (i - 1) as bs a b
58 ( IndexList (i - 1) as bs a b
59 , GIsList () f g as bs
59 , GIsList () f g as bs
60 ) => GHasPosition i (M1 C meta f) (M1 C meta g) a b where
60 ) => GHasPosition i (M1 C meta f) (M1 C meta g) a b where
61− gposition = mIso . (glist @()) . point @(i - 1)
61+ gposition = mIso . glist @() . point @(i - 1)
62
62
63type family Size f :: Nat where
63type family Size f :: Nat where
64 Size (l :*: r)
64 Size (l :*: r)
src/Data/Generics/Product/Internal/Types.hs−1
@@ -5,7 +5,6 @@
5{-# LANGUAGE KindSignatures #-}
5{-# LANGUAGE KindSignatures #-}
6{-# LANGUAGE MultiParamTypeClasses #-}
6{-# LANGUAGE MultiParamTypeClasses #-}
7{-# LANGUAGE ScopedTypeVariables #-}
7{-# LANGUAGE ScopedTypeVariables #-}
8−{-# LANGUAGE TypeApplications #-}
9{-# LANGUAGE TypeFamilies #-}
8{-# LANGUAGE TypeFamilies #-}
10{-# LANGUAGE TypeOperators #-}
9{-# LANGUAGE TypeOperators #-}
11{-# LANGUAGE UndecidableInstances #-}
10{-# LANGUAGE UndecidableInstances #-}
src/Data/Generics/Product/List.hs+1−1
@@ -46,7 +46,7 @@ instance
46 , Generic g
46 , Generic g
47 , GIsList m (Rep f) (Rep g) as bs
47 , GIsList m (Rep f) (Rep g) as bs
48 ) => IsList m f g as bs where
48 ) => IsList m f g as bs where
49− list = repIso . (glist @m)
49+ list = repIso . glist @m
50
50
51class IsList Symbol f g as bs => IsRecord f g (as :: [(Symbol, Type)]) (bs :: [(Symbol, Type)]) | f -> as, g -> bs
51class IsList Symbol f g as bs => IsRecord f g (as :: [(Symbol, Type)]) (bs :: [(Symbol, Type)]) | f -> as, g -> bs
52instance IsList Symbol f g as bs => IsRecord f g as bs
52instance IsList Symbol f g as bs => IsRecord f g as bs
src/Data/Generics/Product/Types.hs−2
@@ -2,10 +2,8 @@
2{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE DataKinds #-}
3{-# LANGUAGE FlexibleContexts #-}
3{-# LANGUAGE FlexibleContexts #-}
4{-# LANGUAGE FlexibleInstances #-}
4{-# LANGUAGE FlexibleInstances #-}
5−{-# LANGUAGE KindSignatures #-}
6{-# LANGUAGE MultiParamTypeClasses #-}
5{-# LANGUAGE MultiParamTypeClasses #-}
7{-# LANGUAGE ScopedTypeVariables #-}
6{-# LANGUAGE ScopedTypeVariables #-}
8−{-# LANGUAGE TypeApplications #-}
9{-# LANGUAGE TypeFamilies #-}
7{-# LANGUAGE TypeFamilies #-}
10{-# LANGUAGE TypeOperators #-}
8{-# LANGUAGE TypeOperators #-}
11{-# LANGUAGE UndecidableInstances #-}
9{-# LANGUAGE UndecidableInstances #-}
src/Data/Generics/Sum/Internal/Constructors.hs+1−1
@@ -55,7 +55,7 @@ instance
55
55
56-- _GCtor = prismP (M1 . gfromCollection . tupleToList) (Right . listToTuple . gtoCollection . unM1)
56-- _GCtor = prismP (M1 . gfromCollection . tupleToList) (Right . listToTuple . gtoCollection . unM1)
57-- {-# INLINE _GCtor #-}
57-- {-# INLINE _GCtor #-}
58− _GCtor = prism (M1 . (view (fromIso (glist @Type))) . tupleToList) (Right . listToTuple . (view (glist @Type)) . unM1)
58+ _GCtor = prism (M1 . view (fromIso (glist @Type)) . tupleToList) (Right . listToTuple . view (glist @Type) . unM1)
59
59
60
60
61instance GSumAsConstructor ctor (HasCtorP ctor l) l r l' r' a b => GAsConstructor ctor (l :+: r) (l' :+: r') a b where
61instance GSumAsConstructor ctor (HasCtorP ctor l) l r l' r' a b => GAsConstructor ctor (l :+: r) (l' :+: r') a b where
src/Data/Generics/Sum/Typed.hs+1−1
@@ -96,7 +96,7 @@ class AsType a s where
96 -- |Project by type.
96 -- |Project by type.
97 projectTyped :: s -> Maybe a
97 projectTyped :: s -> Maybe a
98 projectTyped
98 projectTyped
99− = either (const Nothing) Just . (match _Typed)
99+ = either (const Nothing) Just . match _Typed
100
100
101instance
101instance
102 ( Generic s
102 ( Generic s