From 87cc4c4cb945586bcdd9066f489abf793e7adb92 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Tue, 28 May 2019 19:51:30 -0700 Subject: [PATCH] Rename model parameter to be less verbose. --- src/CacheSim/Model.elm | 2 +- src/CacheSim/Update.elm | 6 +++--- src/Main.elm | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/CacheSim/Model.elm b/src/CacheSim/Model.elm index 0ef4c58..f068892 100644 --- a/src/CacheSim/Model.elm +++ b/src/CacheSim/Model.elm @@ -2,7 +2,7 @@ module CacheSim.Model exposing (..) import CacheSim.Raw exposing (..) type alias Model = - { rawCacheModelHierarchy : RawCacheModelHierarchy + { rawHierarchy : RawCacheModelHierarchy } type alias Flags = () type Msg diff --git a/src/CacheSim/Update.elm b/src/CacheSim/Update.elm index bd94456..5b48e2c 100644 --- a/src/CacheSim/Update.elm +++ b/src/CacheSim/Update.elm @@ -6,7 +6,7 @@ import CacheSim.IntMap exposing (..) updateChangeRawModel : Int -> (RawCacheModel -> RawCacheModel) -> Model -> (Model, Cmd Msg) updateChangeRawModel l f m = let - newModel = { m | rawCacheModelHierarchy = intMapUpdate l f m.rawCacheModelHierarchy } + newModel = { m | rawHierarchy = intMapUpdate l f m.rawHierarchy } cmd = Cmd.none in (newModel, cmd) @@ -15,7 +15,7 @@ updateCreateRawModel : Model -> (Model, Cmd Msg) updateCreateRawModel m = let freshRawModel = { blockSize = "", setCount = "", setSize = "" } - newModel = { m | rawCacheModelHierarchy = m.rawCacheModelHierarchy ++ [ freshRawModel ] } + newModel = { m | rawHierarchy = m.rawHierarchy ++ [ freshRawModel ] } cmd = Cmd.none in (newModel, cmd) @@ -23,7 +23,7 @@ updateCreateRawModel m = updateDeleteRawModel : Int -> Model -> (Model, Cmd Msg) updateDeleteRawModel l m = let - newModel = { m | rawCacheModelHierarchy = intMapDelete l m.rawCacheModelHierarchy } + newModel = { m | rawHierarchy = intMapDelete l m.rawHierarchy } cmd = Cmd.none in (newModel, cmd) diff --git a/src/Main.elm b/src/Main.elm index 407b766..9e8b1cf 100644 --- a/src/Main.elm +++ b/src/Main.elm @@ -16,7 +16,7 @@ init : Flags -> (Model, Cmd Msg) init f = let initialModel = - { rawCacheModelHierarchy = testCacheModelHierarchy + { rawHierarchy = testCacheModelHierarchy } in (initialModel, Cmd.none) @@ -24,7 +24,7 @@ init f = view : Model -> Document Msg view m = { title = "Cache Simulator" - , body = [ viewRawCacheModelHierarchy m.rawCacheModelHierarchy ] + , body = [ viewRawCacheModelHierarchy m.rawHierarchy ] } update : Msg -> Model -> (Model, Cmd Msg)