From 973a039b54327df74396605410ea9abe19c8a4e7 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 4 Sep 2016 21:21:11 +0200 Subject: Upgrade to elm 0.17.1 --- src/Update/UpdateTimer.elm | 57 ---------------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 src/Update/UpdateTimer.elm (limited to 'src/Update/UpdateTimer.elm') diff --git a/src/Update/UpdateTimer.elm b/src/Update/UpdateTimer.elm deleted file mode 100644 index 08b9969..0000000 --- a/src/Update/UpdateTimer.elm +++ /dev/null @@ -1,57 +0,0 @@ -module Update.UpdateTimer - ( TimerAction(..) - , updateTimer - ) where - -import Time exposing (Time) - -import Model.Timer exposing (..) -import Model.TimerState exposing (..) -import Model.Id exposing (..) - -type TimerAction = - Rename String - | Pause - | ToggleRunning - | Stop - | SetTime Time - | SubstractTime Time - -updateTimer : TimerAction -> Timer -> Timer -updateTimer action timer = - case action of - Rename name -> - { timer | name <- Just name } - Pause -> - { timer | state <- Idle } - ToggleRunning -> - { timer - | state <- - if timer.currentTime > 0 && timer.state == Idle - then Running - else Idle - } - Stop -> - { timer - | currentTime <- timer.initialTime - , state <- Idle - } - SetTime time -> - { timer - | initialTime <- time - , currentTime <- time - } - SubstractTime time -> - if timer.state == Running - then - let newTime = timer.currentTime - time - in if newTime <= 0.0 - then - { timer - | currentTime <- 0.0 - , state <- Ringing - } - else - { timer | currentTime <- newTime } - else - timer -- cgit v1.2.3