module Model.Model ( Model , initialModel , numberOfTimers ) where import Dict (Dict) import Dict import Time (Time) import List import Model.Timer (..) import Model.Edition.Edition (..) import Model.Id (..) import Model.IdGenerator (..) type alias Model = { currentTime : Time , timers : Dict Id Timer , timerIdGenerator : IdGenerator , edition : Maybe Edition } initialModel : Time -> Model initialModel initialTime = let (id, idGenerator) = getId initialIdGenerator in { currentTime = initialTime , timers = Dict.insert id (initialTimer initialTime) Dict.empty , timerIdGenerator = idGenerator , edition = Nothing } numberOfTimers : Model -> Int numberOfTimers = List.length << Dict.toList << .timers