basic-sop 0.2.0.2 → 0.2.0.3
raw patch · 3 files changed
+11/−16 lines, 3 filesdep ~QuickCheckdep ~generics-sopPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: QuickCheck, generics-sop
API changes (from Hackage documentation)
- Generics.SOP.Skeleton: instance Generics.SOP.Skeleton.Skeleton (GHC.Base.Maybe a)
+ Generics.SOP.Skeleton: instance Generics.SOP.Skeleton.Skeleton (GHC.Maybe.Maybe a)
- Generics.SOP.Skeleton: class Skeleton a where skeleton = gskeleton
+ Generics.SOP.Skeleton: class Skeleton a
Files
- basic-sop.cabal +7/−7
- src/Generics/SOP/Show.hs +2/−3
- src/Generics/SOP/Skeleton.hs +2/−6
basic-sop.cabal view
@@ -1,5 +1,5 @@ name: basic-sop-version: 0.2.0.2+version: 0.2.0.3 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.8.4, GHC == 7.10.3, GHC == 8.0.1, GHC == 8.0.2, GHC == 8.1.*+tested-with: GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5 source-repository head type: git@@ -28,11 +28,11 @@ Generics.SOP.Show Generics.SOP.Skeleton Generics.SOP.NFData- build-depends: base >= 4.6 && < 5,- generics-sop >= 0.2 && < 0.4,- text >= 1.1 && < 1.3,- QuickCheck >= 2.7 && < 2.10,- deepseq >= 1.3 && < 1.5+ build-depends: base >= 4.6 && < 5,+ generics-sop >= 0.2.3 && < 0.6,+ text >= 1.1 && < 1.3,+ QuickCheck >= 2.7 && < 2.14,+ deepseq >= 1.3 && < 1.5 hs-source-dirs: src default-language: Haskell2010 ghc-options: -Wall
src/Generics/SOP/Show.hs view
@@ -27,9 +27,8 @@ -- gshow :: forall a. (Generic a, HasDatatypeInfo a, All2 Show (Code a)) => a -> String-gshow a = case datatypeInfo (Proxy :: Proxy a) of- ADT _ _ cs -> gshow' cs (from a)- Newtype _ _ c -> gshow' (c :* Nil) (from a)+gshow a =+ gshow' (constructorInfo (datatypeInfo (Proxy :: Proxy a))) (from a) gshow' :: (All2 Show xss, SListI xss) => NP ConstructorInfo xss -> SOP I xss -> String gshow' cs (SOP sop) = hcollapse $ hcliftA2 allp goConstructor cs sop
src/Generics/SOP/Skeleton.hs view
@@ -64,18 +64,14 @@ Generic instance -------------------------------------------------------------------------------} --- | Compute a "spine" for single constructor datatype. That is, a valid of+-- | Compute a "spine" for a single constructor datatype. That is, a valid value of -- that type with a defined spine but undefined everywhere else. For record -- types we give "error" values that mention the names of the fields. gskeleton :: forall a xs. (Generic a, HasDatatypeInfo a, Code a ~ '[xs], All Skeleton xs) => a gskeleton = to $ gskeleton' (datatypeInfo (Proxy :: Proxy a)) 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+gskeleton' d = gskeletonFor (hd (constructorInfo d)) gskeletonFor :: All Skeleton xs => ConstructorInfo xs -> SOP I '[xs] gskeletonFor (Constructor _) = SOP $ Z $ spineWithNames (hpure (K ""))