[Haskell-cafe] uniplate (was: code review?)

John Lato jwlato at gmail.com
Wed May 25 11:10:51 CEST 2011


>
> From: Neil Mitchell <ndmitchell at gmail.com>
>
> > While I'm on the topic, I recently wrote a tool that wanted to
> > traverse deep data structures as produced by haskell-src-exts. ?I
> > wound up with about 50 lines of case expressions and around the time
> > my hands were literally beginning to hurt decided that enough was
> > enough and I should try a generic approach. ?I heard uniplate was
> > pretty easy to use, and was pretty pleased to turn the entire thing
> > into a single line. ?It took me a little longer to figure out I needed
> > to use universeBi since all the examples were monotyped, but once I
> > did it Just Worked. ?Amazing. ?So thanks again! ?And maybe you could
> > mention universeBi in the instant introduction?
>
> Yes, I probably should - I'll try and get to that. Of course, I'd also
> happily accept a patch against
> http://community.haskell.org/~ndm/darcs/uniplate
>
> I use Uniplate inside HLint, and it's invaluable - there are a lot of
> times when List Comp + universeBi really hits the spot.
>

Does Uniplate include an instance for:

> instance Uniplate a => Biplate [a] a
?

Since lists are a common case, I was surprised that this instance wasn't
included.  Is there a reason it shouldn't exist?  I was importing
Data.Generics.Uniplate.Direct FWIW.

Thanks,
John Lato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110525/df385a81/attachment.htm>


More information about the Haskell-Cafe mailing list