basic-sop 0.1.0.5 → 0.2.0.0
raw patch · 4 files changed
+14/−11 lines, 4 filesdep ~generics-sopPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: generics-sop
API changes (from Hackage documentation)
- Generics.SOP.Skeleton: instance Skeleton (Maybe a)
- Generics.SOP.Skeleton: instance Skeleton Bool
- Generics.SOP.Skeleton: instance Skeleton Double
- Generics.SOP.Skeleton: instance Skeleton Int
- Generics.SOP.Skeleton: instance Skeleton Rational
- Generics.SOP.Skeleton: instance Skeleton Text
- Generics.SOP.Skeleton: instance Skeleton [a]
- Generics.SOP.Skeleton: instance Typeable Skeleton
+ Generics.SOP.Skeleton: instance Generics.SOP.Skeleton.Skeleton (GHC.Base.Maybe a)
+ Generics.SOP.Skeleton: instance Generics.SOP.Skeleton.Skeleton Data.Text.Internal.Text
+ Generics.SOP.Skeleton: instance Generics.SOP.Skeleton.Skeleton GHC.Real.Rational
+ Generics.SOP.Skeleton: instance Generics.SOP.Skeleton.Skeleton GHC.Types.Bool
+ Generics.SOP.Skeleton: instance Generics.SOP.Skeleton.Skeleton GHC.Types.Double
+ Generics.SOP.Skeleton: instance Generics.SOP.Skeleton.Skeleton GHC.Types.Int
+ Generics.SOP.Skeleton: instance Generics.SOP.Skeleton.Skeleton [a]
Files
- basic-sop.cabal +3/−3
- src/Generics/SOP/Eq.hs +5/−5
- src/Generics/SOP/Show.hs +5/−2
- src/Generics/SOP/Skeleton.hs +1/−1
basic-sop.cabal view
@@ -1,5 +1,5 @@ name: basic-sop-version: 0.1.0.5+version: 0.2.0.0 synopsis: Basic examples and functions for generics-sop description: This library contains various small examples of generic functions@@ -16,7 +16,7 @@ category: Generics build-type: Simple cabal-version: >=1.10-tested-with: GHC == 7.6.3, GHC == 7.8.2+tested-with: GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.2 source-repository head type: git@@ -29,7 +29,7 @@ Generics.SOP.Skeleton Generics.SOP.NFData build-depends: base >= 4.6 && < 5,- generics-sop >= 0.1 && < 0.2,+ generics-sop >= 0.2 && < 0.3, text >= 1.1 && < 1.3, QuickCheck >= 2.7 && < 2.9, deepseq >= 1.3 && < 1.5
src/Generics/SOP/Eq.hs view
@@ -20,12 +20,12 @@ -- > (==) = geq -- geq :: (Generic a, All2 Eq (Code a)) => a -> a -> Bool-geq = go sing `on` from+geq = go `on` from where- go :: forall xss. (All2 Eq xss) => Sing xss -> SOP I xss -> SOP I xss -> Bool- go SCons (SOP (Z xs)) (SOP (Z ys)) = and . hcollapse $ hcliftA2 p eq xs ys- go SCons (SOP (S xss)) (SOP (S yss)) = go sing (SOP xss) (SOP yss)- go _ _ _ = False+ go :: forall xss. (All2 Eq xss, All SListI xss) => SOP I xss -> SOP I xss -> Bool+ go (SOP (Z xs)) (SOP (Z ys)) = and . hcollapse $ hcliftA2 p eq xs ys+ go (SOP (S xss)) (SOP (S yss)) = go (SOP xss) (SOP yss)+ go _ _ = False p :: Proxy Eq p = Proxy
src/Generics/SOP/Show.hs view
@@ -31,8 +31,8 @@ ADT _ _ cs -> gshow' cs (from a) Newtype _ _ c -> gshow' (c :* Nil) (from a) -gshow' :: (All2 Show xss, SingI xss) => NP ConstructorInfo xss -> SOP I xss -> String-gshow' cs (SOP sop) = unI . hcollapse $ hcliftA2' p goConstructor cs sop+gshow' :: (All2 Show xss, SListI xss) => NP ConstructorInfo xss -> SOP I xss -> String+gshow' cs (SOP sop) = hcollapse $ hcliftA2 allp goConstructor cs sop goConstructor :: All Show xs => ConstructorInfo xs -> NP I xs -> K String xs goConstructor (Constructor n) args =@@ -56,3 +56,6 @@ p :: Proxy Show p = Proxy++allp :: Proxy (All Show)+allp = Proxy
src/Generics/SOP/Skeleton.hs view
@@ -83,7 +83,7 @@ fieldName :: FieldInfo a -> K String a fieldName (FieldInfo n) = K n -spineWithNames :: (All Skeleton xs, SingI xs) => NP (K String) xs -> NP I xs+spineWithNames :: (All Skeleton xs, SListI xs) => NP (K String) xs -> NP I xs spineWithNames = hcliftA ps aux where aux :: Skeleton a => K String a -> I a