Elm types and functions to mimic typeclasses