(in gmail, I just use reply all).
Sorry that I couldn't respond to the previous thread.. I'm using Gmail and not an email client so I couldn't use the reply button. I'll try to resolve this issue soon !Thanks Phillip for responding so quickly,I tried Data.Map first and ran into the issue you mentioned..I've found a way to get around it, but it's ugly and verbose..Instead, I'm wondering if there is a way to use the constructors for the "Val" types below, in place of the keys such as:data Val = Root Root | Oct Oct | Mode Mode deriving (Show, Eq, Ord)And matching against the constructors, instead of resorting to this:import IOimport qualified Data.Map as Maptype Root = Stringtype Oct = Integertype Mode = Integerdata Key = Root | Oct | Mode deriving (Show, Eq, Ord)data Val = Root_v Root | Oct_v Oct | Mode_v Mode deriving (Show, Eq, Ord)test = Map.insert Oct (Oct_v 3) . Map.insert Mode (Mode_v 0) . Map.insert Root (Root_v "2") $ Map.emptymain = print test-- ----> fromList [(Root,Root_v "2"),(Oct,Oct_v 3),(Mode,Mode_v 0)]Many Thanks,Tom
_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell