mirror of
https://github.com/correl/elm.git
synced 2024-11-25 11:09:53 +00:00
15 lines
412 B
Elm
15 lines
412 B
Elm
module Etl exposing (transform)
|
|
|
|
import Dict exposing (Dict)
|
|
|
|
|
|
transform : Dict Int (List String) -> Dict String Int
|
|
transform input =
|
|
Dict.foldl addLetters Dict.empty input
|
|
|
|
|
|
addLetters : Int -> List String -> Dict String Int -> Dict String Int
|
|
addLetters score letters output =
|
|
letters
|
|
|> List.map String.toLower
|
|
|> List.foldl (\letter output -> Dict.insert letter score output) output
|