Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Backport to support text 0.7

  • Loading branch information...
commit 7392940b8692c63a7654002f254490e1cedb58bf 1 parent 57d2722
Bryan O'Sullivan bos authored
Showing with 11 additions and 1 deletion.
  1. +10 −0 Data/Convertible/Instances/Text.hs
  2. +1 −1  convertible.cabal
10 Data/Convertible/Instances/Text.hs
View
@@ -1,3 +1,5 @@
+{-# LANGUAGE CPP #-}
+
{- |
Module : Data.Convertible.Instances.Text
Copyright : Copyright (C) 2011 MailRank, Inc.
@@ -47,11 +49,19 @@ instance Convertible [Char] TL.Text where
instance Convertible TL.Text [Char] where
safeConvert = Right . TL.unpack
+#if MIN_VERSION_text(0,8,1)
instance Convertible TS.Text TL.Text where
safeConvert = Right . TL.fromStrict
instance Convertible TL.Text TS.Text where
safeConvert = Right . TL.toStrict
+#else
+instance Convertible TS.Text TL.Text where
+ safeConvert = Right . TL.fromChunks . (:[])
+
+instance Convertible TL.Text TS.Text where
+ safeConvert = Right . TS.concat . TL.toChunks
+#endif
-- ByteString
2  convertible.cabal
View
@@ -59,7 +59,7 @@ library
Build-Depends: time<1.1.3
else
Build-Depends: base<3
- Build-Depends: mtl, text
+ Build-Depends: mtl, text >= 0.7
GHC-Options: -O2 -Wall -fno-warn-orphans
Please sign in to comment.
Something went wrong with that request. Please try again.