Thread overview
Practical approach to generic programming
Feb 12, 2003
Mark Evans
Feb 12, 2003
Sean L. Palmer
Feb 12, 2003
Arjan Knepper
February 12, 2003
http://www.research.microsoft.com/~simonpj/papers/hmap/

'We describe a design pattern that for writing programs that traverse data structures built from rich mutually-recursive data types. Such programs often have a great deal of "boilerplate" code that simply walks the structure, hiding a small amount of "real" code that constitutes the reason for the traversal.

'Our technique allows most of this boilerplate to be written once and for all (perhaps even mechanically generated), leaving the programmer free to concentrate on the important part of the algorithm. These generic programs are much more robust to data structure evolution because they contain many fewer lines of type-specific code.

'Our approach is simple to understand, reasonably efficient, and it handles all the data types found in conventional functional programming languages. It makes essential use of rank-2 polymorphism, an extension found in some implementations of Haskell.'


February 12, 2003
Truly an idea whose time has come.  Now if I could just view .ps more easily...

Sean

"Mark Evans" <Mark_member@pathlink.com> wrote in message news:b2chih$2a1m$1@digitaldaemon.com...
> http://www.research.microsoft.com/~simonpj/papers/hmap/
>
> 'We describe a design pattern that for writing programs that traverse data structures built from rich mutually-recursive data types. Such programs
often
> have a great deal of "boilerplate" code that simply walks the structure,
hiding
> a small amount of "real" code that constitutes the reason for the
traversal.
>
> 'Our technique allows most of this boilerplate to be written once and for
all
> (perhaps even mechanically generated), leaving the programmer free to concentrate on the important part of the algorithm. These generic programs
are
> much more robust to data structure evolution because they contain many
fewer
> lines of type-specific code.
>
> 'Our approach is simple to understand, reasonably efficient, and it
handles all
> the data types found in conventional functional programming languages. It
makes
> essential use of rank-2 polymorphism, an extension found in some
implementations
> of Haskell.'


February 12, 2003
GSview is a free ps viewer, might need the also free GhostScript
http://www.cs.wisc.edu/~ghost/

Sean L. Palmer wrote:
> Truly an idea whose time has come.  Now if I could just view .ps more
> easily...
> 
> Sean
> 
> "Mark Evans" <Mark_member@pathlink.com> wrote in message
> news:b2chih$2a1m$1@digitaldaemon.com...
> 
>>http://www.research.microsoft.com/~simonpj/papers/hmap/
>>
>>'We describe a design pattern that for writing programs that traverse data
>>structures built from rich mutually-recursive data types. Such programs
> 
> often
> 
>>have a great deal of "boilerplate" code that simply walks the structure,
> 
> hiding
> 
>>a small amount of "real" code that constitutes the reason for the
> 
> traversal.
> 
>>'Our technique allows most of this boilerplate to be written once and for
> 
> all
> 
>>(perhaps even mechanically generated), leaving the programmer free to
>>concentrate on the important part of the algorithm. These generic programs
> 
> are
> 
>>much more robust to data structure evolution because they contain many
> 
> fewer
> 
>>lines of type-specific code.
>>
>>'Our approach is simple to understand, reasonably efficient, and it
> 
> handles all
> 
>>the data types found in conventional functional programming languages. It
> 
> makes
> 
>>essential use of rank-2 polymorphism, an extension found in some
> 
> implementations
> 
>>of Haskell.'
> 
> 
>