<div dir="ltr">I'm not using any lens libraries, I'm writing both encodings from scratch based on standard libs, as a learning path.<div>I see anyway that Traversing class is declaring exactly the Twan -> Profunctor promotion (given the Applicative on f) which looks a lot like a white flag on the "write traversal as profunctor" research.</div><div>Actually I was induced from purescript to think that the profunctorial encoding was completely alternative to the twan, but I had no evidence of the fact, so I should better dig into purescript library.</div><div><br></div><div>.p</div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-05-02 18:43 GMT+02:00 Tom Ellis <span dir="ltr"><<a href="mailto:tom-lists-haskell-cafe-2013@jaguarpaw.co.uk" target="_blank">tom-lists-haskell-cafe-2013@jaguarpaw.co.uk</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm not sure what you mean. If you want to write a profunctor traversal<br>
then `wander lq5Twan` seems fine. If you want to understand why it's hard<br>
to directly write profunctor traversals then I'm afraid I'm as puzzled as<br>
you.<br>
<div class="HOEnZb"><div class="h5"><br>
On Wed, May 02, 2018 at 06:29:09PM +0200, Paolino wrote:<br>
> Well, I can accept it as an evidence of why not to use the profunctor<br>
> encoding for multi target lens (if that's the name).<br>
> But I guess we are already in philosophy (so I'm more puzzled than before)<br>
> and I hope you can elaborate more.<br>
> <br>
> .p<br>
> <br>
> <br>
> 2018-05-02 18:10 GMT+02:00 Tom Ellis <<br>
> <a href="mailto:tom-lists-haskell-cafe-2013@jaguarpaw.co.uk">tom-lists-haskell-cafe-2013@<wbr>jaguarpaw.co.uk</a>>:<br>
> <br>
> > On Wed, May 02, 2018 at 03:07:05PM +0200, Paolino wrote:<br>
> > > I'm trying to write a lens for a datatype which seems easy in the Twan<br>
> > van<br>
> > > Laarhoven encoding but I cannot find it as easy in the profunctorial one<br>
> > ><br>
> > > data Q5 a b = Q51 a (Identity b) | Q52 [b]<br>
> > ><br>
> > > lq5Twan :: Applicative f => (b -> f b') -> Q5 a b -> f (Q5 a b')<br>
> > > lq5Twan f (Q51 a bs) = Q51 a <$> traverse f bs<br>
> > > lq5Twan f (Q52 bs) = Q52 <$> traverse f bs<br>
> > [...]<br>
> > > lq5Profunctor :: forall p a b b' . Traversing p => p b b' -> p (Q5 a<br>
> > > b) (Q5 a b')<br>
> > [...]<br>
> > > Which simpler ways to write the lq5Profunctor we have ?<br>
> ><br>
> > Is `wander lq5Twan` good enough, or is your question more philosophical?<br>
<br>
______________________________<wbr>_________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/haskell-<wbr>cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</div></div></blockquote></div><br></div>