Talk:GHC/Type families

From HaskellWiki
Revision as of 10:16, 13 July 2007 by Andreas (talk | contribs) (GMapInt or GMAp Int)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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)