[Haskell-cafe] fast, strongly typed heterogeneous collections

Serguey Zefirov sergueyz at gmail.com
Fri Feb 19 07:20:30 EST 2010

2010/2/19 Alberto G. Corona <agocorona at gmail.com>:
> What is the speed of hProjectByLabel/s in Data.HList.Record? . The
> documentation in hackage does not mention it. Perhaps this is because Hlist
> is designed for supposedly short records and this does not matter too much.
> looking at the code I guess that everything in HList is O(n) because it uses
> type-level list structure, but I think that nothing prevents from using a
> type level balanced tree, Data.Map style, instead.

GHC could inline most of what looks like O(n).

And, actually, what looks like O(n) at the compile time is O(1) at
runtime. This is so because it is really hard to create types at
runtime. ;)

More information about the Haskell-Cafe mailing list