packages feed

convert 1.0.1 → 1.0.2

raw patch · 5 files changed

+31/−3 lines, 5 files

Files

convert.cabal view
@@ -1,5 +1,5 @@ name: convert-version: 1.0.1+version: 1.0.2 cabal-version: >=1.10 build-type: Simple license: Apache-2.0@@ -24,6 +24,7 @@         Data.Convert.Bound         Data.Convert.Errors         Data.Convert.Instances+        Data.Convert.Instances.Base         Data.Convert.Instances.Map         Data.Convert.Instances.Num         Data.Convert.Instances.Text
src/Data/Convert/Base.hs view
@@ -66,8 +66,15 @@  -- instances -instance {-# OVERLAPPABLE #-} Castable    a a where cast    = id ; {-# INLINE cast    #-}-instance {-# OVERLAPPABLE #-} Convertible a a where convert = id ; {-# INLINE convert #-}+-- The following instances are commented out because they are pure EVIL.+-- Lets consider following situation - we've got an instance:+--     instance Castable (Edge src tgt) (Edge src' tgt') where ...+-- if we use it passing the same arguments it will overlap with the +--     instance Castable a a +-- in such way it ould be not possible to resolve by GHC!+-- +-- instance {-# OVERLAPPABLE #-} Castable    a a where cast    = id ; {-# INLINE cast    #-}+-- instance {-# OVERLAPPABLE #-} Convertible a a where convert = id ; {-# INLINE convert #-}  instance {-# OVERLAPPABLE #-} Convertible a b => Convertible (Maybe a) (Maybe b) where convert = fmap convert ; {-# INLINE convert #-} 
src/Data/Convert/Instances.hs view
@@ -1,5 +1,6 @@ module Data.Convert.Instances () where +import Data.Convert.Instances.Base    () import Data.Convert.Instances.Map     () import Data.Convert.Instances.Num     () import Data.Convert.Instances.Text    ()
+ src/Data/Convert/Instances/Base.hs view
@@ -0,0 +1,5 @@+module Data.Convert.Instances.Base where++import Data.Convert.Base++instance Castable a a' => Castable [a] [a'] where cast = fmap cast ; {-# INLINE cast #-}
src/Data/Convert/Instances/Text.hs view
@@ -25,6 +25,9 @@ import Data.Foldable  +instance Convertible TS.Text TS.Text where+    {-# INLINE convert #-}+    convert = id  instance Convertible TS.Text [Char] where     {-# INLINE convert #-}@@ -57,6 +60,10 @@   +instance Convertible TL.Text TL.Text where+    {-# INLINE convert #-}+    convert = id+ instance Convertible TL.Text [Char] where     {-# INLINE convert #-}     convert = TL.unpack@@ -88,6 +95,10 @@   +instance Convertible TLB.Builder TLB.Builder where+    {-# INLINE convert #-}+    convert = id+ instance Convertible TLB.Builder [Char] where     {-# INLINE convert #-}     convert = convert . TLB.toLazyText@@ -113,6 +124,9 @@     convert = convert . TLB.toLazyText  +instance Convertible BS.ByteString BS.ByteString where+    {-# INLINE convert #-}+    convert = id  instance Convertible BS.ByteString [Word8] where     {-# INLINE convert #-}