case Map.lookup key cache of
-- Found in cache, just return
Just value -> return value
-- Not found, compute it and put it in the cache
Nothing -> do
value <- create
case Map.lookup key cache of
-- Found in cache, just return
Just value -> return value
-- Not found, compute it and put it in the cache
Nothing -> do
value <- create