module Model exposing ( Model , init , numberOfTimers ) import Dict exposing (Dict) import Dict import Time exposing (Time) import List import Msg exposing (Msg) import Model.Id exposing (..) import Model.IdGenerator exposing (..) import Timer.Model as Timer exposing (Timer) import Edition.Model exposing (Edition) type alias Model = { time : Time , timers : Dict Id Timer , timerIdGenerator : IdGenerator , edition : Maybe Edition } init : Time -> (Model, Cmd Msg) init initialTime = let (id, idGenerator) = getId initialIdGenerator model = { time = initialTime , timers = Dict.insert id (Timer.init initialTime) Dict.empty , timerIdGenerator = idGenerator , edition = Nothing } in (model, Cmd.none) numberOfTimers : Model -> Int numberOfTimers = List.length << Dict.toList << .timers