aboutsummaryrefslogtreecommitdiff
path: root/src/Update/UpdateEdition.elm
diff options
context:
space:
mode:
Diffstat (limited to 'src/Update/UpdateEdition.elm')
-rw-r--r--src/Update/UpdateEdition.elm33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/Update/UpdateEdition.elm b/src/Update/UpdateEdition.elm
deleted file mode 100644
index 47b0e22..0000000
--- a/src/Update/UpdateEdition.elm
+++ /dev/null
@@ -1,33 +0,0 @@
-module Update.UpdateEdition
- ( updateEdition
- , EditionAction(..)
- ) where
-
-import Char
-import Char exposing (KeyCode)
-
-import Model.Edition.Edition exposing (..)
-
-import Utils.List exposing (..)
-
-type EditionAction =
- DeleteLast
- | AddChar KeyCode
-
-updateEdition : EditionAction -> Edition -> Edition
-updateEdition action edition =
- case action of
- DeleteLast ->
- case maybeTail edition.chars of
- Just tailChars ->
- { edition | chars <- tailChars }
- Nothing ->
- edition
- AddChar keyCode ->
- case keyCodeToChar edition.kind keyCode of
- Just char ->
- if keyCode == 32 && maybeHead edition.chars == Just (Char.fromCode 32)
- then edition
- else { edition | chars <- char :: edition.chars }
- Nothing ->
- edition