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