
13 Jun
2010
13 Jun
'10
9:52 a.m.
Marc Weber wrote:
Does anybody have a less-insane way of doing this?
Sure:
type MyMap = Map (KeyID, Key) Value
Don't use multiple keys. Put the keys into a tuple and use that as key.
Let me know whether this is what you were looking for.
Trouble is, this requires you to have *all* the keys to perform a single lookup. You can't do a lookup on just one attribute.
I tried writing something like this. Yet SQL gives all this stiff for free.
[Except that SQL bindings don't work on Windows. Besides, I'm only working with small data volumes, I don't need persistence or transaction guarantees, etc.]
I still wonder which is the nicest way to express this data in Haskell without coding everything yourself..
Indeed.