th-utilities 0.1.1.0 → 0.1.1.1
raw patch · 3 files changed
+11/−10 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- TH.ReifyDataType: instance GHC.Generics.Constructor TH.ReifyDataType.C1_0DataCon
- TH.ReifyDataType: instance GHC.Generics.Constructor TH.ReifyDataType.C1_0DataType
- TH.ReifyDataType: instance GHC.Generics.Datatype TH.ReifyDataType.D1DataCon
- TH.ReifyDataType: instance GHC.Generics.Datatype TH.ReifyDataType.D1DataType
- TH.ReifyDataType: instance GHC.Generics.Selector TH.ReifyDataType.S1_0_0DataCon
- TH.ReifyDataType: instance GHC.Generics.Selector TH.ReifyDataType.S1_0_0DataType
- TH.ReifyDataType: instance GHC.Generics.Selector TH.ReifyDataType.S1_0_1DataCon
- TH.ReifyDataType: instance GHC.Generics.Selector TH.ReifyDataType.S1_0_1DataType
- TH.ReifyDataType: instance GHC.Generics.Selector TH.ReifyDataType.S1_0_2DataCon
- TH.ReifyDataType: instance GHC.Generics.Selector TH.ReifyDataType.S1_0_2DataType
- TH.ReifyDataType: instance GHC.Generics.Selector TH.ReifyDataType.S1_0_3DataCon
- TH.ReifyDataType: instance GHC.Generics.Selector TH.ReifyDataType.S1_0_3DataType
Files
- README.md +1/−2
- test/TH/DeriveSpec/TH.hs +9/−7
- th-utilities.cabal +1/−1
README.md view
@@ -1,7 +1,6 @@ # th-utilities -[](https://travis-ci.org/commercialhaskell/stack)-[](https://travis-ci.org/commercialhaskell/stack)+[](https://travis-ci.org/fpco/th-utilities) The 'th-utilities' package provides a number of useful utilities for [Template Haskell](https://hackage.haskell.org/package/template-haskell-2.10.0.0).
test/TH/DeriveSpec/TH.hs view
@@ -4,16 +4,17 @@ module TH.DeriveSpec.TH where -import TH.Derive-import Language.Haskell.TH import Data.Proxy+import Language.Haskell.TH+import TH.Derive+import TH.Utilities class InstShowBlind a instance Instantiator (InstShowBlind a) where runInstantiator _ preds (AppT (ConT ((== ''InstShowBlind) -> True)) ty) []= do expr <- [| \_ -> "ShowBlind" |]- return [InstanceD preds (AppT (ConT ''Show) ty) [ValD (VarP 'show) (NormalB expr) []]]+ return [plainInstanceD preds (AppT (ConT ''Show) ty) [ValD (VarP 'show) (NormalB expr) []]] runInstantiator _ _ _ _ = fail "Theoretically impossible case in InstShowBlind instantiator for Show" @@ -23,10 +24,11 @@ runInstantiator _ preds (AppT (ConT ((== ''InstShowConst) -> True)) ty) decls = dequalifyMethods ''InstShowConst =<< sequence- [ instanceD (return preds) [t| Show $(return ty) |] $- [valD (varP 'show)- (normalB [| \_ -> _constResult undefined |])- (map return decls)]]+ [do headTy <- [t| Show $(return ty) |]+ method <- valD (varP 'show)+ (normalB [| \_ -> _constResult undefined |])+ (map return decls)+ return (plainInstanceD preds headTy [method])] runInstantiator _ _ _ _ = fail "Theoretically impossible case in InstShowConst instantiator for Show"
th-utilities.cabal view
@@ -3,7 +3,7 @@ -- see: https://github.com/sol/hpack name: th-utilities-version: 0.1.1.0+version: 0.1.1.1 synopsis: Collection of useful functions for use with Template Haskell homepage: https://github.com/fpco/th-utilities#readme bug-reports: https://github.com/fpco/th-utilities/issues