Using associated data types to create unpacked data structures

Johan Tibell johan.tibell at
Fri Aug 13 02:00:58 EDT 2010

On Fri, Aug 13, 2010 at 1:14 AM, Max Bolingbroke <batterseapower at
> wrote:

> On 12 August 2010 20:31, Johan Tibell <johan.tibell at> wrote:
> > Yes and dead code elimination should also be able to get rid of much of
> the
> > code duplication even before it reaches the linker.
> I don't think dead code elimination will help, because presumably you
> want to generate specialisations on demand. This means that
> specialisations will only be generated if they have at least one
> caller. Unless the caller is itself dead, it will be entirely up to
> the linker to common-up stuff and reduce the code bloat.

I guess I was thinking that if you naively duplicated the whole Map module
(instead of individual functions) once per caller then much of the generated
code would become dead as the caller is unlikely to use all the functions in
the module.

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Glasgow-haskell-users mailing list