Introduce state with Map for caching compilation, but results are worse

This commit is contained in:
John J. Camilleri
2021-03-12 13:39:56 +01:00
parent 8f5033e4ce
commit 6c6a201d96
3 changed files with 357 additions and 209 deletions

View File

@@ -23,6 +23,10 @@ empty = IMB {
valMap = HashMap.empty
}
-- | An empty IntMap
emptyIntMap :: IntMap a
emptyIntMap = IntMap.empty
-- | Lookup a value
lookup :: (Eq a, Hashable a) => a -> IMB a -> Maybe Int
lookup a IMB { valMap = vm } = HashMap.lookup a vm