aboutsummaryrefslogtreecommitdiffhomepage
path: root/Pipes/Text
diff options
context:
space:
mode:
authormichaelt <what_is_it_to_do_anything@yahoo.com>2014-06-15 18:16:42 -0400
committermichaelt <what_is_it_to_do_anything@yahoo.com>2014-06-15 18:16:42 -0400
commitc3c19f9b4f0564f3fae39a18555f6cfb322ee7c9 (patch)
tree1526701c93533d619c74ff1889050403c484b98c /Pipes/Text
parent79917d53aa8a1e2c8332e330337f74440859306d (diff)
downloadtext-pipes-c3c19f9b4f0564f3fae39a18555f6cfb322ee7c9.tar.gz
text-pipes-c3c19f9b4f0564f3fae39a18555f6cfb322ee7c9.tar.zst
text-pipes-c3c19f9b4f0564f3fae39a18555f6cfb322ee7c9.zip
started generalizing lenses
Diffstat (limited to 'Pipes/Text')
-rw-r--r--Pipes/Text/Encoding.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/Pipes/Text/Encoding.hs b/Pipes/Text/Encoding.hs
index 991000f..99433b7 100644
--- a/Pipes/Text/Encoding.hs
+++ b/Pipes/Text/Encoding.hs
@@ -64,6 +64,9 @@ import Pipes
64type Lens'_ a b = forall f . Functor f => (b -> f b) -> (a -> f a) 64type 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) 65type Iso'_ a b = forall f p . (Functor f, Profunctor p) => p b (f b) -> p a (f a)
66 66
67type Lens s t a b = forall f . Functor f => (a -> f b) -> (s -> f t)
68
69
67{- $lenses 70{- $lenses
68 The 'Codec' type is a simple specializion of 71 The 'Codec' type is a simple specializion of
69 the @Lens'_@ type synonymn used by the standard lens libraries, 72 the @Lens'_@ type synonymn used by the standard lens libraries,
@@ -79,11 +82,12 @@ type Iso'_ a b = forall f p . (Functor f, Profunctor p) => p b (f b) -> p a (f a
79 -} 82 -}
80 83
81type Codec 84type Codec
82 = forall m r 85 = forall m x y
83 . Monad m 86 . Monad m
84 => Lens'_ (Producer ByteString m r) 87 => Lens (Producer ByteString m x)
85 (Producer Text m (Producer ByteString m r)) 88 (Producer ByteString m y)
86 89 (Producer Text m (Producer ByteString m x))
90 (Producer Text m (Producer ByteString m y))
87{- | 'decode' is just the ordinary @view@ or @(^.)@ of the lens libraries; 91{- | 'decode' is just the ordinary @view@ or @(^.)@ of the lens libraries;
88 exported here under a name appropriate to the material. All of these are 92 exported here under a name appropriate to the material. All of these are
89 the same: 93 the same: