aboutsummaryrefslogtreecommitdiffhomepage
path: root/Pipes/Text
diff options
context:
space:
mode:
authormichaelt <what_is_it_to_do_anything@yahoo.com>2014-06-26 21:40:43 +0200
committermichaelt <what_is_it_to_do_anything@yahoo.com>2014-06-26 21:40:43 +0200
commit2f4a83f82d206217456a035b7e8a1e56c585bfd0 (patch)
tree1a6882a4eece84bbf187273b81e4a04378da13df /Pipes/Text
parent57454c33c13da1f07101bf096b010b4d2ce97292 (diff)
downloadtext-pipes-2f4a83f82d206217456a035b7e8a1e56c585bfd0.tar.gz
text-pipes-2f4a83f82d206217456a035b7e8a1e56c585bfd0.tar.zst
text-pipes-2f4a83f82d206217456a035b7e8a1e56c585bfd0.zip
Bumped bounds for pipes-bytestring. Made types agree with pipes-bytestring where possible. Scrapped Iso and profunctor
Diffstat (limited to 'Pipes/Text')
-rw-r--r--Pipes/Text/Encoding.hs12
1 files changed, 4 insertions, 8 deletions
diff --git a/Pipes/Text/Encoding.hs b/Pipes/Text/Encoding.hs
index 991000f..e00cd43 100644
--- a/Pipes/Text/Encoding.hs
+++ b/Pipes/Text/Encoding.hs
@@ -41,13 +41,10 @@ module Pipes.Text.Encoding
41 , decodeAscii 41 , decodeAscii
42 , encodeIso8859_1 42 , encodeIso8859_1
43 , decodeIso8859_1 43 , decodeIso8859_1
44 , Lens'_
45 , Iso'_
46 ) 44 )
47 where 45 where
48 46
49import Data.Functor.Constant (Constant(..)) 47import Data.Functor.Constant (Constant(..))
50import Data.Profunctor (Profunctor)
51import Data.Char (ord) 48import Data.Char (ord)
52import Data.ByteString as B 49import Data.ByteString as B
53import Data.ByteString (ByteString) 50import Data.ByteString (ByteString)
@@ -61,16 +58,15 @@ import Control.Monad (join)
61import Data.Word (Word8) 58import Data.Word (Word8)
62import Pipes 59import Pipes
63 60
64type Lens'_ a b = forall f . Functor f => (b -> f b) -> (a -> f a) 61type Lens' a b = forall f . Functor f => (b -> f b) -> (a -> f a)
65type Iso'_ a b = forall f p . (Functor f, Profunctor p) => p b (f b) -> p a (f a)
66 62
67{- $lenses 63{- $lenses
68 The 'Codec' type is a simple specializion of 64 The 'Codec' type is a simple specializion of
69 the @Lens'_@ type synonymn used by the standard lens libraries, 65 the @Lens'@ type synonymn used by the standard lens libraries,
70 <http://hackage.haskell.org/package/lens lens> and 66 <http://hackage.haskell.org/package/lens lens> and
71 <http://hackage.haskell.org/package/lens-family lens-family>. That type, 67 <http://hackage.haskell.org/package/lens-family lens-family>. That type,
72 68
73> type Lens'_ a b = forall f . Functor f => (b -> f b) -> (a -> f a) 69> type Lens' a b = forall f . Functor f => (b -> f b) -> (a -> f a)
74 70
75 is just an alias for a Prelude type. Thus you use any particular codec with 71 is just an alias for a Prelude type. Thus you use any particular codec with
76 the @view@ / @(^.)@ , @zoom@ and @over@ functions from either of those libraries; 72 the @view@ / @(^.)@ , @zoom@ and @over@ functions from either of those libraries;
@@ -81,7 +77,7 @@ type Iso'_ a b = forall f p . (Functor f, Profunctor p) => p b (f b) -> p a (f a
81type Codec 77type Codec
82 = forall m r 78 = forall m r
83 . Monad m 79 . Monad m
84 => Lens'_ (Producer ByteString m r) 80 => Lens' (Producer ByteString m r)
85 (Producer Text m (Producer ByteString m r)) 81 (Producer Text m (Producer ByteString m r))
86 82
87{- | 'decode' is just the ordinary @view@ or @(^.)@ of the lens libraries; 83{- | 'decode' is just the ordinary @view@ or @(^.)@ of the lens libraries;