I would prefer to keep them the way they are, because the full `Lens` 
functionality isn’t used just for `zoom` but also for other utilities like 
`over` or `set`.  It’s easier to just warn users that a lens is improper than 
to create parallel versions of every utility that a person might want to use 
with these `Lens`es.

> On Mar 6, 2016, at 6:06 AM, Thomas Wilkinson <[email protected]> 
> wrote:
> 
> I am slightly freaked out by the `Lens`es provided by `Pipes.Parse` being 
> 'improper'.  Could they not be `Getter`s instead?
> 
>     type Splitter a m = forall x. Getter (Producer a m x) (Producer a m 
> (Producer a m x))
>     -- Should have   " join . view sp == id "     for any sp :: Splitter a m  
> and  p :: Producer a m r
> 
>     span :: Monad m => (a -> Bool) -> Splitter a m
>     splitAt :: Monad m => Int -> Splitter a m
>     groupBy :: Monad m => (a -> a -> Bool) -> Splitter a m
>     group :: (Monad m, Eq a) => Splitter a m
> 
>     -- would replace `zoom`
>     split :: Splitter a m -> Parser a m r -> Parser a m r
>     split sp st = StateT $ \p -> fmap (fmap join) (runStateT st (p^.sp))
> 
> This means that users would sometimes have to use `zoom` and sometimes have 
> to use `split`, which might be annoying.  But it feels better than having 
> fake `Lens`es somehow.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Haskell Pipes" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.

-- 
You received this message because you are subscribed to the Google Groups 
"Haskell Pipes" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].

Reply via email to