summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefanWehr <>2017-01-21 05:19:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2017-01-21 05:19:00 (GMT)
commit9cb1e5226f113229881d3eeca8d440285efa949c (patch)
treed8586503dfbfc91b78e64fb286fa72b0ef280ee2
parentbcbea9bbc4d958f6cf5a757217e018351f240794 (diff)
version 0.2.0.5HEAD0.2.0.5master
-rw-r--r--roundtrip.cabal2
-rw-r--r--src/Control/Isomorphism/Partial/TH.hs6
-rw-r--r--src/Text/Roundtrip/Classes.hs2
-rw-r--r--src/Text/Roundtrip/Combinators.hs4
4 files changed, 10 insertions, 4 deletions
diff --git a/roundtrip.cabal b/roundtrip.cabal
index 4b7d606..39455d0 100644
--- a/roundtrip.cabal
+++ b/roundtrip.cabal
@@ -1,5 +1,5 @@
Name: roundtrip
-Version: 0.2.0.3
+Version: 0.2.0.5
Synopsis: Bidirectional (de-)serialization
Description: Roundtrip allows the definition of bidirectional
(de-)serialization specifications. The specification language
diff --git a/src/Control/Isomorphism/Partial/TH.hs b/src/Control/Isomorphism/Partial/TH.hs
index d327156..b73bb37 100644
--- a/src/Control/Isomorphism/Partial/TH.hs
+++ b/src/Control/Isomorphism/Partial/TH.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE TemplateHaskell #-}
module Control.Isomorphism.Partial.TH
( defineIsomorphisms
@@ -29,8 +30,13 @@ defineIsomorphisms' :: Name -> (String -> String) -> Q [Dec]
defineIsomorphisms' d renameFun =
do info <- reify d
let cs = case info of
+#if MIN_VERSION_template_haskell(2,11,0)
+ TyConI (DataD _ _ _ _ cs _) -> cs
+ TyConI (NewtypeD _ _ _ _ c _) -> [c]
+#else
TyConI (DataD _ _ _ cs _) -> cs
TyConI (NewtypeD _ _ _ c _) -> [c]
+#endif
otherwise -> error $ show d ++
" neither denotes a data or newtype declaration. Found: " ++
show info
diff --git a/src/Text/Roundtrip/Classes.hs b/src/Text/Roundtrip/Classes.hs
index 53e8327..895a000 100644
--- a/src/Text/Roundtrip/Classes.hs
+++ b/src/Text/Roundtrip/Classes.hs
@@ -1,5 +1,7 @@
module Text.Roundtrip.Classes where
+import Prelude hiding ((<*>), pure)
+
import Data.Eq (Eq)
import Data.Char (Char)
diff --git a/src/Text/Roundtrip/Combinators.hs b/src/Text/Roundtrip/Combinators.hs
index a9cfbcb..aec738e 100644
--- a/src/Text/Roundtrip/Combinators.hs
+++ b/src/Text/Roundtrip/Combinators.hs
@@ -33,13 +33,11 @@ module Text.Roundtrip.Combinators
, xmlString
) where
-import Prelude hiding ((.), foldl)
+import Prelude hiding (pure, (*>), (<*), (<*>), (<$>), (.), foldl)
import Control.Category ((.))
import Data.Char (isSpace)
-import Data.Maybe (Maybe)
-import Data.Either (Either)
import qualified Data.Text as T