prairie 0.0.1.0 → 0.0.1.1
raw patch · 3 files changed
+20/−6 lines, 3 filesdep ~template-haskellPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: template-haskell
API changes (from Hackage documentation)
- Prairie.Class: data family Field rec :: Type -> Type;
+ Prairie.Class: data Field rec :: Type -> Type;
+ Prairie.TH: compatConP :: Name -> Pat
Files
- ChangeLog.md +4/−1
- prairie.cabal +2/−2
- src/Prairie/TH.hs +14/−3
ChangeLog.md view
@@ -1,3 +1,6 @@ # Changelog for prairie -## Unreleased changes+## 0.0.1.1++* [#4](https://github.com/parsonsmatt/prairie/pull/4)+ * Compatibility with `template-haskell-2.18` and above
prairie.cabal view
@@ -1,7 +1,7 @@ cabal-version: 1.12 name: prairie-version: 0.0.1.0+version: 0.0.1.1 description: Please see the README on GitHub at <https://github.com/parsonsmatt/prairie#readme> homepage: https://github.com/parsonsmatt/prairie#readme bug-reports: https://github.com/parsonsmatt/prairie/issues@@ -35,7 +35,7 @@ , constraints , containers , lens- , template-haskell >= 2.15 && < 2.17+ , template-haskell >= 2.15 && < 2.20 , text other-modules:
src/Prairie/TH.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE CPP #-}+ -- | Helpers for generating instances of the 'Record' type class. -- -- @since 0.0.1.0@@ -115,7 +117,7 @@ pure $ Match- (ConP (mkConstrFieldName fieldName) [])+ (compatConP (mkConstrFieldName fieldName)) (NormalB $ VarE 'lens `AppE` VarE fieldName@@ -160,7 +162,7 @@ constrFieldName = mkConstrFieldName n pat =- ConP constrFieldName []+ compatConP constrFieldName bdy = AppE (VarE 'Text.pack) $ LitE $ StringL $ nameBase $ stripTypeName n @@ -213,7 +215,7 @@ fieldDictBody = CaseE (VarE fieldVar) $ map mkFieldDictMatches fieldConstructors mkFieldDictMatches (name, _type) =- Match (ConP name []) (NormalB (ConE 'Dict)) []+ Match (compatConP name) (NormalB (ConE 'Dict)) [] pure $ InstanceD@@ -245,3 +247,12 @@ upperFirst, lowerFirst :: String -> String upperFirst = overFirst toUpper lowerFirst = overFirst toLower++compatConP :: Name -> Pat+#if MIN_VERSION_template_haskell(2,18,0)+compatConP constrFieldName =+ ConP constrFieldName [] []+#else+compatConP constrFieldName =+ ConP constrFieldName []+#endif