[Haskell-cafe] Harder than you'd think

Marc Weber marco-oweber at gmx.de
Sun Jun 13 09:15:43 EDT 2010


> What I ended up writing is this: 
> http://www.hpaste.org/fastcgi/hpaste.fcgi/view?id=25782
>   lookup :: KeyID -> Key -> Container -> Maybe Value

> 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.

I tried writing something like this. Yet SQL gives all this stiff for
free. I still wonder which is the nicest way to express this data in
Haskell without coding everything yourself..

Yours
Marc Weber


More information about the Haskell-Cafe mailing list