module Model.Edition.Edition ( Edition , Kind(..) , newEdition , keyCodeToChar ) where import Keyboard (KeyCode) import Model.Id (..) import Model.Edition.NameEdition as NameEdition import Model.Edition.TimeEdition as TimeEdition type alias Edition = { id : Id , kind : Kind , chars : List Char } type Kind = Name | Time newEdition id kind = { id = id , kind = kind , chars = [] } keyCodeToChar : Kind -> KeyCode -> Maybe Char keyCodeToChar kind = case kind of Name -> NameEdition.keyCodeToChar Time -> TimeEdition.keyCodeToChar