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 (..) import CacheSim.Raw exposing (..)
type alias Model = type alias Model =
{ rawCacheModelHierarchy : RawCacheModelHierarchy { rawHierarchy : RawCacheModelHierarchy
} }
type alias Flags = () type alias Flags = ()
type Msg type Msg

View File

@ -6,7 +6,7 @@ import CacheSim.IntMap exposing (..)
updateChangeRawModel : Int -> (RawCacheModel -> RawCacheModel) -> Model -> (Model, Cmd Msg) updateChangeRawModel : Int -> (RawCacheModel -> RawCacheModel) -> Model -> (Model, Cmd Msg)
updateChangeRawModel l f m = updateChangeRawModel l f m =
let let
newModel = { m | rawCacheModelHierarchy = intMapUpdate l f m.rawCacheModelHierarchy } newModel = { m | rawHierarchy = intMapUpdate l f m.rawHierarchy }
cmd = Cmd.none cmd = Cmd.none
in in
(newModel, cmd) (newModel, cmd)
@ -15,7 +15,7 @@ updateCreateRawModel : Model -> (Model, Cmd Msg)
updateCreateRawModel m = updateCreateRawModel m =
let let
freshRawModel = { blockSize = "", setCount = "", setSize = "" } freshRawModel = { blockSize = "", setCount = "", setSize = "" }
newModel = { m | rawCacheModelHierarchy = m.rawCacheModelHierarchy ++ [ freshRawModel ] } newModel = { m | rawHierarchy = m.rawHierarchy ++ [ freshRawModel ] }
cmd = Cmd.none cmd = Cmd.none
in in
(newModel, cmd) (newModel, cmd)
@ -23,7 +23,7 @@ updateCreateRawModel m =
updateDeleteRawModel : Int -> Model -> (Model, Cmd Msg) updateDeleteRawModel : Int -> Model -> (Model, Cmd Msg)
updateDeleteRawModel l m = updateDeleteRawModel l m =
let let
newModel = { m | rawCacheModelHierarchy = intMapDelete l m.rawCacheModelHierarchy } newModel = { m | rawHierarchy = intMapDelete l m.rawHierarchy }
cmd = Cmd.none cmd = Cmd.none
in in
(newModel, cmd) (newModel, cmd)

View File

@ -16,7 +16,7 @@ init : Flags -> (Model, Cmd Msg)
init f = init f =
let let
initialModel = initialModel =
{ rawCacheModelHierarchy = testCacheModelHierarchy { rawHierarchy = testCacheModelHierarchy
} }
in in
(initialModel, Cmd.none) (initialModel, Cmd.none)
@ -24,7 +24,7 @@ init f =
view : Model -> Document Msg view : Model -> Document Msg
view m = view m =
{ title = "Cache Simulator" { title = "Cache Simulator"
, body = [ viewRawCacheModelHierarchy m.rawCacheModelHierarchy ] , body = [ viewRawCacheModelHierarchy m.rawHierarchy ]
} }
update : Msg -> Model -> (Model, Cmd Msg) update : Msg -> Model -> (Model, Cmd Msg)