Personal tools

Talk:GHC/Type families

From HaskellWiki

Revision as of 10:16, 13 July 2007 by Andreas (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

I believe the instance declaration:

instance GMapKey Int where

 data GMap Int v        = GMapInt (Data.Map.Map Int v)
 empty                  = GMapInt Data.Map.empty
 lookup k (GMapInt m)   = Data.Map.lookup k m
 insert k v (GMapInt m) = GMapInt (Data.Map.insert k v m)

should be:

instance GMapKey Int where

 data GMap Int v        = GMap Int (Data.Map.Map Int v)
 empty                  = GMap Int Data.Map.empty
 lookup k (GMapInt m)   = Data.Map.lookup k m
 insert k v (GMapInt m) = GMap Int (Data.Map.insert k v m)