[Haskell-cafe] Examples for Control.Lens.Plated?

mantkiew at gsd.uwaterloo.ca mantkiew at gsd.uwaterloo.ca
Thu Sep 3 01:31:01 UTC 2015

+1 I've been missing such examples for a long time too. 


  Original Message  
From: Andrey Chudnov
Sent: Wednesday, September 2, 2015 7:44 PM
To: haskell-cafe
Subject: [Haskell-cafe] Examples for Control.Lens.Plated?

Hello Cafe,
I'm considering porting some of my code that uses uniplate to lens. But 
Control.Lens.Plated is giving me headaches. So I'm looking for remedy.

Has anyone used it and willing to share examples? I hope that seeing 
some of the combinators in action would help me understand the type 
signatures and documentation. What I'm particularly interested in is the 
1) implementation of something like transformBi and rewriteBi using lens
2) usage of *On, *Off and *OnOff combinators (e.g., transformMOn, 
transformMOff, transformMOnOff). What I want to understand is the 
difference between the 3 variants. Also, what does it mean to "Transform 
every element in the tree in a region indicated by a supplied Traversal" 
and how exactly does the traversal define the region.
3) any recursive tree traversals/transformations using Plated that stop 
the recursion at a certain point (e.g., upon seeing a certain constructor)

I hope this isn't too vague, but, please, let me know if it is.

Haskell-Cafe mailing list
Haskell-Cafe at haskell.org

More information about the Haskell-Cafe mailing list