[Haskell-cafe] Call for discussion: OverloadedLists extension

wren ng thornton wren at freegeek.org
Thu Sep 27 02:02:00 CEST 2012

On 9/24/12 8:53 AM, George Giorgidze wrote:
> We will release GHC patches for both approaches, meanwhile the
> feedback from the community on the approaches that we took would be
> very much appreciated. Which one those would you prefer? or would you
> suggest a different one.

The first one is much cleaner, and more closely mirrors the other 
overloaded literals. It seems that in most cases the intermediate list 
should be eliminated via build/foldr fusion. Did you do any testing to 
figure out why that fusion wasn't happening? (I.e., *why* is the generic 
approach faster?)

The only other thing I'll mention is that for overloadable strings, part 
of the reason why they're so fast is that string literals are stored a 
la C, and so the conversion to ByteString and Text requires minimal 
work. I wonder if you might be able to leverage a similar technique for 
representing list literals as vectors, which are then inflated to 
lists/vectors/sets/whatever at runtime.

Live well,

More information about the Haskell-Cafe mailing list