[Haskell-cafe] MultiParamClasses question
Eugeny N Dzhurinsky
bofh at redwerk.com
Wed May 26 04:31:05 EDT 2010
On Tue, May 25, 2010 at 10:46:47PM +0100, Stephen Tetley wrote:
> Hi Eugene
>
> You can store different things in a Map by collecting them with a
> simple 'sum' type:
Hello, Stephen!
The records to be stored into a Map are not related to each other. So wrapping
them into another type is not very smart solution in my case :)
The problem is really with the fact that records, created from such lines
user_1_name=user
group_1_name=group
do refer to the same key 1. But you gave me idea that I can use single map -
but as a key use something like
type KeyT k i = (k,i)
where k is type of record (Group or User), and i is index, usually Int.
This way I will try to redesign my existing code.
Thank you for the idea :)
--
Eugene Dzhurinsky
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20100526/5c97392d/attachment.bin
More information about the Haskell-Cafe
mailing list