pretty-sop 0.1.0.1 → 0.2.0.0
raw patch · 3 files changed
+11/−8 lines, 3 filesdep ~generics-sopPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: generics-sop
API changes (from Hackage documentation)
Files
- LICENSE +1/−1
- pretty-sop.cabal +4/−4
- src/Generics/SOP/PrettyVal.hs +6/−3
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2014, Well-Typed LLP, Edsko de Vries, Andres Löh+Copyright (c) 2014-2015, Well-Typed LLP, Edsko de Vries, Andres Löh All rights reserved. Redistribution and use in source and binary forms, with or without
pretty-sop.cabal view
@@ -1,5 +1,5 @@ name: pretty-sop-version: 0.1.0.1+version: 0.2.0.0 synopsis: A generic pretty-printer using generics-sop description: This library contains a generic implementation of the 'prettyVal'@@ -14,11 +14,11 @@ license: BSD3 license-file: LICENSE author: Edsko de Vries <edsko@well-typed.com>, Andres Löh <andres@well-typed.com>-maintainer: edsko@well-typed.com+maintainer: andres@well-typed.com 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@@ -27,7 +27,7 @@ library exposed-modules: Generics.SOP.PrettyVal build-depends: base >= 4.6 && < 5,- generics-sop >= 0.1 && < 0.2,+ generics-sop >= 0.2 && < 0.3, pretty-show >= 1.6 && < 1.7 hs-source-dirs: src default-language: Haskell2010
src/Generics/SOP/PrettyVal.hs view
@@ -30,13 +30,13 @@ gprettyVal :: forall a. (Generic a, HasDatatypeInfo a, All2 PrettyVal (Code a)) => a -> Value gprettyVal = gprettyVal' (datatypeInfo (Proxy :: Proxy a)) . from -gprettyVal' :: (All2 PrettyVal xss, SingI xss) => DatatypeInfo xss -> SOP I xss -> Value+gprettyVal' :: (All2 PrettyVal xss, All SListI xss) => DatatypeInfo xss -> SOP I xss -> Value gprettyVal' (ADT _ _ cs) = gprettyVal'' cs gprettyVal' (Newtype _ _ c) = gprettyVal'' (c :* Nil) -gprettyVal'' :: (All2 PrettyVal xss, SingI xss) => NP ConstructorInfo xss -> SOP I xss -> Value+gprettyVal'' :: (All2 PrettyVal xss, All SListI xss) => NP ConstructorInfo xss -> SOP I xss -> Value gprettyVal'' info (SOP sop) =- unI . hcollapse $ hcliftA2' p prettyValFor info sop+ hcollapse $ hcliftA2 allp prettyValFor info sop prettyValFor :: All PrettyVal xs => ConstructorInfo xs -> NP I xs -> K Value xs prettyValFor (Constructor n) = K . Con n . hcollapse . hcliftA p (K . prettyVal . unI)@@ -52,3 +52,6 @@ p :: Proxy PrettyVal p = Proxy++allp :: Proxy (All PrettyVal)+allp = Proxy