basic-sop 0.2.0.0 → 0.2.0.1
raw patch · 3 files changed
+16/−11 lines, 3 filesdep ~QuickCheckPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: QuickCheck
API changes (from Hackage documentation)
- Generics.SOP.Arbitrary: garbitrary :: (Generic a, All2 Arbitrary (Code a)) => Gen a
+ Generics.SOP.Arbitrary: garbitrary :: forall a. (Generic a, All2 Arbitrary (Code a)) => Gen a
- Generics.SOP.Show: gshow :: (Generic a, HasDatatypeInfo a, All2 Show (Code a)) => a -> String
+ Generics.SOP.Show: gshow :: forall a. (Generic a, HasDatatypeInfo a, All2 Show (Code a)) => a -> String
Files
- basic-sop.cabal +5/−4
- src/Generics/SOP/Show.hs +2/−0
- src/Generics/SOP/Skeleton.hs +9/−7
basic-sop.cabal view
@@ -1,5 +1,5 @@ name: basic-sop-version: 0.2.0.0+version: 0.2.0.1 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.4, GHC == 7.10.2+tested-with: GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.1, GHC == 8.0.2, GHC == 8.1.* source-repository head type: git@@ -31,12 +31,13 @@ build-depends: base >= 4.6 && < 5, generics-sop >= 0.2 && < 0.3, text >= 1.1 && < 1.3,- QuickCheck >= 2.7 && < 2.9,+ QuickCheck >= 2.7 && < 2.10, deepseq >= 1.3 && < 1.5 hs-source-dirs: src default-language: Haskell2010 ghc-options: -Wall- default-extensions: ScopedTypeVariables+ default-extensions: CPP+ ScopedTypeVariables TypeFamilies RankNTypes TypeOperators
src/Generics/SOP/Show.hs view
@@ -49,7 +49,9 @@ goConstructor (Infix n _ _) (arg1 :* arg2 :* Nil) = K $ show arg1 ++ " " ++ show n ++ " " ++ show arg2+#if __GLASGOW_HASKELL__ < 800 goConstructor (Infix _ _ _) _ = error "inaccessible"+#endif goField :: Show a => FieldInfo a -> I a -> K String a goField (FieldInfo field) (I a) = K $ field ++ " = " ++ show a
src/Generics/SOP/Skeleton.hs view
@@ -1,8 +1,8 @@ -- | Generic computation of a skeleton.------ $skeleton----module Generics.SOP.Skeleton (Skeleton(..)) where+module Generics.SOP.Skeleton (+ -- $skeleton+ Skeleton(..)+ ) where import Control.Exception import Data.Text (Text)@@ -73,15 +73,17 @@ gskeleton' :: All Skeleton xs => DatatypeInfo '[xs] -> SOP I '[xs] gskeleton' (ADT _ _ (c :* Nil)) = gskeletonFor c gskeleton' (Newtype _ _ c) = gskeletonFor c+#if __GLASGOW_HASKELL__ < 800 gskeleton' _ = error "inaccessible"+#endif gskeletonFor :: All Skeleton xs => ConstructorInfo xs -> SOP I '[xs] gskeletonFor (Constructor _) = SOP $ Z $ spineWithNames (hpure (K "")) gskeletonFor (Infix _ _ _) = SOP $ Z $ spineWithNames (hpure (K ""))-gskeletonFor (Record _ fs) = SOP $ Z $ spineWithNames (hliftA fieldName fs)+gskeletonFor (Record _ fs) = SOP $ Z $ spineWithNames (hliftA sfieldName fs) where- fieldName :: FieldInfo a -> K String a- fieldName (FieldInfo n) = K n+ sfieldName :: FieldInfo a -> K String a+ sfieldName (FieldInfo n) = K n spineWithNames :: (All Skeleton xs, SListI xs) => NP (K String) xs -> NP I xs spineWithNames = hcliftA ps aux