Add code to create fresh cache.

This commit is contained in:
Danila Fedorin 2019-05-28 19:01:51 -07:00
parent ddfd65b099
commit 559821f54a

View File

@ -128,3 +128,11 @@ accessCache wa c =
Just (Ok ar) -> Ok <| transformAccess ar Just (Ok ar) -> Ok <| transformAccess ar
Just (Err e) -> Err <| "Error accessing cache set: " ++ e Just (Err e) -> Err <| "Error accessing cache set: " ++ e
Nothing -> Err "Unable to find correct set in cache." Nothing -> Err "Unable to find correct set in cache."
freshCache : CacheModel -> Cache
freshCache cm =
let
set = List.repeat cm.setSize Empty
sets = List.repeat cm.setCount set
in
(cm, sets)