On Sun, Oct 10, 2010 at 10:51 PM, Alexander Solla a...@2piix.com wrote:
Is there anyway to instruct GHC (and maybe other compilers) to compute these
maps statically? Are GHC and the other compilers smart enough to do it
automatically? Although the list isn't huge, I would still rather get rid
On Sun, 10 Oct 2010 18:51:59 -0700, Alexander Solla a...@2piix.com
wrote:
Although the list isn't huge, I would still rather get rid of the
O(2*n) operation of turning it into maps at run-time.
I usually handle this as follows:
1) I create my data file in some human-friendly format (such as
Hi everybody,
I'm working on a module that encodes static facts about the real
world. For now, I'm working on an ISO 3166 compliant list of
countries, country names, and country codes. I've run into a bit of
an optimization issue.
There is a static bijective correspondence between
I would not worry about doing that at runtime.
The only reliable way to make sure it happens at compile time that I
can think of would be some Template Haskell.
(Or some really deep magic with dictionaries.)
-- Lennart
On Mon, Oct 11, 2010 at 3:51 AM, Alexander Solla a...@2piix.com wrote:
Hi