moduleSystem.Mem.StableName.Dynamic.Map(Map,empty,null,singleton,member,notMember,insert,insertWith,insertWith',lookup,find,findWithDefault)whereimportqualifiedPreludeimportPreludehiding(lookup,null)importSystem.Mem.StableName.DynamicimportqualifiedData.IntMapasIntMapimportData.IntMap(IntMap)newtypeMapa=Map{getMap::IntMap[(DynamicStableName,a)]}empty::Mapaempty=MapIntMap.emptynull::Mapa->Boolnull(Mapm)=IntMap.nullmsingleton::DynamicStableName->a->Mapasingletonkv=Map$IntMap.singleton(hashDynamicStableNamek)[(k,v)]member::DynamicStableName->Mapa->Boolmemberkm=caselookupkmofNothing->FalseJust_->TruenotMember::DynamicStableName->Mapa->BoolnotMemberkm=not$memberkminsert::DynamicStableName->a->Mapa->Mapainsertkv=Map.IntMap.insertWith(++)(hashDynamicStableNamek)[(k,v)].getMap-- | /O(log n)/. Insert with a function for combining the new value and old value.-- @'insertWith' f key value mp@-- will insert the pair (key, value) into @mp@ if the key does not exist-- in the map. If the key does exist, the function will insert the pair-- @(key, f new_value old_value)@insertWith::(a->a->a)->DynamicStableName->a->Mapa->MapainsertWithfkv=Map.IntMap.insertWithgo(hashDynamicStableNamek)[(k,v)].getMapwherego_((k',v'):kvs)|k==k'=(k',fvv'):kvs|otherwise=(k',v'):goundefinedkvsgo_[]=[]-- | Same as 'insertWith', but with the combining function applied strictly.insertWith'::(a->a->a)->DynamicStableName->a->Mapa->MapainsertWith'fkv=Map.IntMap.insertWithgo(hashDynamicStableNamek)[(k,v)].getMapwherego_((k',v'):kvs)|k==k'=letv''=fvv'inv''`seq`(k',v''):kvs|otherwise=(k',v'):goundefinedkvsgo_[]=[]-- | /O(log n)/. Lookup the value at a key in the map.-- -- The function will return the corresponding value as a @('Just' value)@-- or 'Nothing' if the key isn't in the map.lookup::DynamicStableName->Mapv->Maybevlookupk(Mapm)=dopairs<-IntMap.lookup(hashDynamicStableNamek)mPrelude.lookupkpairsfind::DynamicStableName->Mapv->vfindkm=caselookupkmofNothing->error"Map.find: element not in the map"Justx->x-- | /O(log n)/. The expression @('findWithDefault' def k map)@ returns-- the value at key @k@ or returns the default value @def@-- when the key is not in the map.findWithDefault::v->DynamicStableName->Mapv->vfindWithDefaultdfltkm=maybedfltid$lookupkm