Re: Proposal: Value strict versions of containers

Forgot to add libraries@
On Mon, May 23, 2011 at 4:29 PM, Johan Tibell
On Mon, May 23, 2011 at 4:18 PM, Sebastian Fischer
wrote: 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)`?
Exactly. This would amount to code generation in the module defining IntMap (Lazy a), similar to how C++ implements template.
I thought GHC would eliminate the indirection and extra words with -funbox-strict-fields.
Unfortunately not.
Johan

Tallying informal votes, it appears we are +5 in favor of Strict and Lazy modules with the same underlying representation, with deprecation of strict methods in Data.IntMap. I will be implementing this at Hac Phi tomorrow. Cheers, Edward

Here is the implementation: http://hpaste.org/49733 I'd appreciate sanity checking. The way this works is that if a function is not mentioned here, we use the lazy version. All strict functions assume both maps are strict on input, and are maximally lazy because of this (for example, "strict" union will not inspect any values, because both input maps have fully evaluated values.) Cheers, Edward Excerpts from Edward Z. Yang's message of Sat Jul 30 23:43:09 -0400 2011:
Tallying informal votes, it appears we are +5 in favor of Strict and Lazy modules with the same underlying representation, with deprecation of strict methods in Data.IntMap.
I will be implementing this at Hac Phi tomorrow.
Cheers, Edward
participants (2)
-
Edward Z. Yang
-
Johan Tibell