Add code to create fresh cache.
This commit is contained in:
parent
ddfd65b099
commit
559821f54a
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user