Lyle Kopnicky wrote:
[snip]
listRecords :: AbsString s => TextTable s -> IO [TextRecord s]
listRecords (TextTable fields _ records) = do
keyRecs <- HT.toList records
return $ map (fromList . zip fields . elems . snd) keyRecs
Doing fromList again and again can't be good. Why don't you make
tableFields a map that maps names to array indices? Then you can just
pass the bare arrays along, and the later lookups will be cheaper, too.
That might make a difference. It does spoil the interface a bit, since
now the caller has to look up a field name to get an index, then use
that to look up a value, instead of just using the field name to get
the value.