diff options
author | michaelt <what_is_it_to_do_anything@yahoo.com> | 2014-06-26 21:40:43 +0200 |
---|---|---|
committer | michaelt <what_is_it_to_do_anything@yahoo.com> | 2014-06-26 21:40:43 +0200 |
commit | 2f4a83f82d206217456a035b7e8a1e56c585bfd0 (patch) | |
tree | 1a6882a4eece84bbf187273b81e4a04378da13df /Pipes/Text | |
parent | 57454c33c13da1f07101bf096b010b4d2ce97292 (diff) | |
download | text-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.hs | 12 |
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 | ||
49 | import Data.Functor.Constant (Constant(..)) | 47 | import Data.Functor.Constant (Constant(..)) |
50 | import Data.Profunctor (Profunctor) | ||
51 | import Data.Char (ord) | 48 | import Data.Char (ord) |
52 | import Data.ByteString as B | 49 | import Data.ByteString as B |
53 | import Data.ByteString (ByteString) | 50 | import Data.ByteString (ByteString) |
@@ -61,16 +58,15 @@ import Control.Monad (join) | |||
61 | import Data.Word (Word8) | 58 | import Data.Word (Word8) |
62 | import Pipes | 59 | import Pipes |
63 | 60 | ||
64 | type Lens'_ a b = forall f . Functor f => (b -> f b) -> (a -> f a) | 61 | 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) | ||
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 | |||
81 | type Codec | 77 | type 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; |