replaced Haskell snipped with Elm code