typeEnvab=FiniteMapabnewEnv::EnvabnewEnv=emptyFMaddToEnv::Orda=>Envab->a->b->EnvabaddToEnvfmkeyelt=addToFMfmkeyeltdelFromEnv::Orda=>Envab->a->EnvabdelFromEnvfmkey=delFromFMfmkeyaddToEnv_C::Orda=>(b->b->b)->Envab->a->b->EnvabaddToEnv_Cffmkeyelt=addToFM_Cffmkeyelt-- The same behaviour as addToEnv, but it really doesn't hurt-- to be explicit about this.replaceElt::Orda=>Envab->a->b->EnvabreplaceEltfmkeynew_elt=addToFM_C(\_new->new)fmkeynew_eltaddListToEnv::Orda=>Envab->[(a,b)]->EnvabaddListToEnvfmls=addListToFMfmlsaddListToEnv_C::Orda=>(b->b->b)->Envab->[(a,b)]->EnvabaddListToEnv_Cffmls=addListToFM_CffmlslookupEnv::Orda=>Envab->a->MaybeblookupEnvfmk=lookupFMfmkenvToList::Envab->[(a,b)]envToListfm=fmToListfmmapEnv::(a->b->c)->Envab->EnvacmapEnvffm=mapFMffmmapMaybeEnv::Orda=>(a->b->Maybec)->Envab->EnvacmapMaybeEnvffm=mapMaybeFMffmunionEnvs::(Orda)=>[Envab]->EnvabunionEnvsls=foldl(\accx->plusFMxacc)newEnvls