text-1.2.1 compat module
authorJoachim Breitner <mail@joachim-breitner.de>
Tue, 26 May 2015 07:55:43 +0000 (09:55 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Tue, 26 May 2015 07:55:43 +0000 (09:55 +0200)
gipeda.cabal
src/Data/Text/Binary.hs [new file with mode: 0644]
src/Development/Shake/Gitlib.hs

index 079a945..821e960 100644 (file)
@@ -57,7 +57,8 @@ executable gipeda
     Shake,
     Summary,
     WithLatestLogs,
-    Development.Shake.Gitlib
+    Development.Shake.Gitlib,
+    Data.Text.Binary
 
 
   build-depends:
diff --git a/src/Data/Text/Binary.hs b/src/Data/Text/Binary.hs
new file mode 100644 (file)
index 0000000..82c0ed6
--- /dev/null
@@ -0,0 +1,12 @@
+{-# LANGUAGE CPP #-}
+module Data.Text.Binary where
+
+#if MIN_VERSION_text(1,2,1)
+#else
+-- I do not want a new dependency just for these, so this is copied from text-binary
+instance Binary T.Text where
+    put = put . T.encodeUtf8
+    get = T.decodeUtf8 <$> get
+#endif
+
+
index 81aa853..ceb27a7 100644 (file)
@@ -18,20 +18,14 @@ import Development.Shake
 import Development.Shake.Rule
 import Development.Shake.Classes
 
+import Data.Text.Binary
+
 import Git
 import Git.Libgit2
 import Data.Tagged
 
 type RepoPath = FilePath
 
-
--- I do not want a new dependency just for these, so this is copied from text-binary
-instance Binary T.Text where
-    put = put . T.encodeUtf8
-    get = T.decodeUtf8 <$> get
-
-
-
 newtype GetGitReferenceQ = GetGitReferenceQ (RepoPath, RefName)
     deriving (Typeable,Eq,Hashable,Binary,NFData,Show)