Proposal: Value strict versions of containers

Sebastian Fischer fischer at nii.ac.jp
Mon May 23 16:18:47 CEST 2011


On Mon, May 23, 2011 at 2:14 PM, Johan Tibell <johan.tibell at gmail.com>wrote:

> On Mon, May 23, 2011 at 1:31 PM, Sebastian Fischer <fischer at nii.ac.jp>
> wrote:
> > Would it be efficient to define a
> > type Data.IntMap.Strict.IntMap with strict fields (also for values) and
> then
> > define Data.IntMap.Lazy in terms of this implementation and a wrapper
> type?
>
> Not really, it adds two words worth of overhead and one extra indirection.


Because unboxing can not be used for the polymorphic value component in the
strict structure and there is no way to tell GHC to unbox the specific
instantiation `IntMap (Lazy a)`?

I thought GHC would eliminate the indirection and extra words with
-funbox-strict-fields.

Sebastian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20110523/68c74946/attachment.htm>


More information about the Libraries mailing list