Rename model parameter to be less verbose.

This commit is contained in:
Danila Fedorin 2019-05-28 19:51:30 -07:00
parent 77bd953b95
commit 87cc4c4cb9
3 changed files with 6 additions and 6 deletions

View File

@ -2,7 +2,7 @@ module CacheSim.Model exposing (..)
import CacheSim.Raw exposing (..)
type alias Model =
{ rawCacheModelHierarchy : RawCacheModelHierarchy
{ rawHierarchy : RawCacheModelHierarchy
}
type alias Flags = ()
type Msg

View File

@ -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)

View File

@ -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)