The & is the same as $ with arguments inverted. So instead of

t & myField . traversed . otherField %~ (++ "X")

you could write

myField . traversed . otherField %~ (++ "X") $ t

(if I recall correctly...)
Michal

On Fri, Oct 10, 2014 at 11:03 AM, Nicola Gigante <nicola.gigante@gmail.com> wrote:

Il giorno 10/ott/2014, alle ore 16:36, Daniel Trstenjak <daniel.trstenjak@gmail.com> ha scritto:

>
> Hi Nicola,
>
> there's 'traversed' to access every entry of a traversable structure,
> e.g. appending a "X" at the end of each 'otherField':
>
>   t & myField . traversed . otherField %~ (++ "X")
>
>
> And there's '^..' to return a list of each entry of a traversable structure:
>
>   t ^.. myField . traversed . otherField
>

Thank you for both the answers!

So my error was to presume that everything can be
done with (^.) (which is view, if I’m correct).

So I have to understand now, what is the & operator?

>
> Greetings,
> Daniel

Thank you,
Nicola
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe