Rename model parameter to be less verbose.
This commit is contained in:
parent
77bd953b95
commit
87cc4c4cb9
|
@ -2,7 +2,7 @@ module CacheSim.Model exposing (..)
|
|||
import CacheSim.Raw exposing (..)
|
||||
|
||||
type alias Model =
|
||||
{ rawCacheModelHierarchy : RawCacheModelHierarchy
|
||||
{ rawHierarchy : RawCacheModelHierarchy
|
||||
}
|
||||
type alias Flags = ()
|
||||
type Msg
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user