packages feed

th-abstraction 0.2.4.0 → 0.2.5.0

raw patch · 3 files changed

+52/−1 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Language.Haskell.TH.Datatype: newtypeDCompat :: CxtQ -> Name -> [TyVarBndr] -> ConQ -> [Name] -> DecQ
+ Language.Haskell.TH.Datatype: pragLineDCompat :: Int -> String -> Maybe DecQ
+ Language.Haskell.TH.Datatype: tySynInstDCompat :: Name -> [TypeQ] -> TypeQ -> DecQ

Files

ChangeLog.md view
@@ -1,5 +1,9 @@ # Revision history for th-abstraction +## 0.2.5.0++* Added `pragLineDCompat`, `newtypeDCompat` and `tySynInstDCompat`+ ## 0.2.4.0 -- 2017-07-31  * Fix bug that caused GADT equality constraints to be incorrect in some cases.
src/Language/Haskell/TH/Datatype.hs view
@@ -88,6 +88,9 @@    -- * Backward compatible data definitions   , dataDCompat+  , newtypeDCompat+  , tySynInstDCompat+  , pragLineDCompat   , arrowKCompat    -- * Strictness annotations@@ -1418,6 +1421,50 @@     (return (map ConT ds)) #else dataDCompat = dataD+#endif++-- | Backward compatible version of 'newtypeD'+newtypeDCompat ::+  CxtQ        {- ^ context                 -} ->+  Name        {- ^ type constructor        -} ->+  [TyVarBndr] {- ^ type parameters         -} ->+  ConQ        {- ^ constructor definition  -} ->+  [Name]      {- ^ derived class names     -} ->+  DecQ+#if MIN_VERSION_template_haskell(2,12,0)+newtypeDCompat c n ts cs ds =+  newtypeD c n ts Nothing cs+    (if null ds then [] else [derivClause Nothing (map conT ds)])+#elif MIN_VERSION_template_haskell(2,11,0)+newtypeDCompat c n ts cs ds =+  newtypeD c n ts Nothing cs+    (return (map ConT ds))+#else+newtypeDCompat = newtypeD+#endif++-- | Backward compatible version of 'tySynInstD'+tySynInstDCompat ::+  Name    {- ^ type family name    -} ->+  [TypeQ] {- ^ instance parameters -} ->+  TypeQ   {- ^ instance result     -} ->+  DecQ+#if MIN_VERSION_template_haskell(2,9,0)+tySynInstDCompat n ps r = TySynInstD n <$> (TySynEqn <$> sequence ps <*> r)+#else+tySynInstDCompat = tySynInstD+#endif++-- | Backward compatible version of 'pragLineD'. Returns+-- 'Nothing' if line pragmas are not suported.+pragLineDCompat ::+  Int     {- ^ line number -} ->+  String  {- ^ file name   -} ->+  Maybe DecQ+#if MIN_VERSION_template_haskell(2,10,0)+pragLineDCompat ln fn = Just (pragLineD ln fn)+#else+pragLineDCompat _  _  = Nothing #endif  arrowKCompat :: Kind -> Kind -> Kind
th-abstraction.cabal view
@@ -1,5 +1,5 @@ name:                th-abstraction-version:             0.2.4.0+version:             0.2.5.0 synopsis:            Nicer interface for reified information about data types description:         This package normalizes variations in the interface for                      inspecting datatype information via Template Haskell