[Haskell-cafe] newbie: maintaining relationships

Neil Mitchell ndmitchell at gmail.com
Sat May 24 18:04:27 EDT 2008


Hi

>> Give the following code below, my question is - how do i setup a
>> dependency of User on Common?
>
> Perhaps a first attempt should not have Common store a reference to User,
> nor User store a reference to Common. Instead, have two Data.Map.Map's: one
> looks up from Common to User, one from User to Common.

Sounds like a bidirectional Map to me - fortunately hackage already
has one of these:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bimap

Thanks

Neil


More information about the Haskell-Cafe mailing list