[Haskell-cafe] lost in generics

José Pedro Magalhães jpm at cs.uu.nl
Thu Oct 20 19:26:42 CEST 2011

Hi Rusi,

GHC has built-in support for two generic programming libraries. SYB [1]
support has been there for a long time. The new generic mechanism [2], which
allows you to define your own, (almost) derivable classes, only appeared in
7.2, but is planned to stay.

What library you should use depends on what you want to do. There's a
(slightly outdated) paper about that [3]. If you're looking into AST
manipulations, SYB (or Uniplate [4]) might be the best pick. For most things
I prefer the new generic mechanism, though.


[1] http://www.cs.uu.nl/wiki/GenericProgramming/SYB
[3] http://citeseer.ist.psu.edu/viewdoc/summary?doi=
[4] http://community.haskell.org/~ndm/uniplate/

On Thu, Oct 20, 2011 at 18:12, Rustom Mody <rustompmody at gmail.com> wrote:

> I need some help finding my way around the various generics libraries.
> My usage scenario is -- at least to start with -- the ASTs of programming
> languages.
> It appears to me that there are two generations of generics -- earlier
> there was generic haskell and strafunski
> Now there is uniplate and kure (and syb? -- not sure of its generation...)
> I get this impression because I saw a comment somewhat along these lines.
> And also the very first reference link on the strafunski webpage:
> http://www.haskell.org/haskellwiki/Applications_and_libraries/Generic_programming/Strafunski
> viz http://www.cs.vu.nl/Strafunski/
> seems to be dead. So I am wondering whether strafunski is still under
> development or is it defunct?
> The following paras from
> http://www.cs.uu.nl/research/techreps/repo/CS-2008/2008-010.pdf
> The current status of generic programming in Haskell is comparable
>> to the lazy Tower of Babel preceding the birth of Haskell
>> in the eighties [Hudak et al., 2007]. We have many single-site languages
>> or libraries, each individually lacking critical mass in terms
>> of language/library-design effort, implementations, and users.
> Although generic programming has been used in several applications,
>> it has few users for real-life projects. This is understandable.
>> Developing a large application takes a couple of years, and
>> choosing a particular approach to generic programming for such a
>> project involves a risk. Few approaches that have been developed
>> over the last decade are still supported, and there is a high risk that
>> the chosen approach will not be supported anymore, or that it will
>> change in a backwards-incompatible way in a couple of years time.
>  sound omninous :-)
> In general my question is:  What is alive/active and what is alive/active
> and what is -- um -- moved-on-from.
> And of course which are easier and which more difficult to dig into.
> Thanks
> Rusi
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111020/2f321fd0/attachment.htm>

More information about the Haskell-Cafe mailing list