1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 22:31:36 +03:00

Eta-expand cacheSet.

This commit is contained in:
Rob Rix 2017-12-20 16:16:03 -05:00
parent 5488187caf
commit 2b6e3974c2

View File

@ -23,7 +23,7 @@ cacheLookup :: (Ord l, Ord t, Ord v, Ord (Cell l v)) => Configuration l t v -> C
cacheLookup key = Map.lookup key . unCache
cacheSet :: (Ord l, Ord t, Ord v, Ord (Cell l v)) => Configuration l t v -> Set (v, Store l v) -> Cache l t v -> Cache l t v
cacheSet = (((Cache .) . (. unCache)) .) . Map.insert
cacheSet key value = Cache . Map.insert key value . unCache
cacheInsert :: (Ord l, Ord t, Ord v, Ord (Cell l v)) => Configuration l t v -> (v, Store l v) -> Cache l t v -> Cache l t v
cacheInsert = (((Cache .) . (. unCache)) .) . (. point) . Map.insertWith (<>)