[Haskell-cafe] Harder than you'd think

Andrew Coppin andrewcoppin at btinternet.com
Sun Jun 13 09:52:18 EDT 2010


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.



More information about the Haskell-Cafe mailing list