Just create a range of numbers and map it to characters:
List.map Char.fromCode [97..122]
Change or as a function:
charRange : Char -> Char -> List Char charRange from to = List.map Char.fromCode [(Char.toCode from)..(Char.toCode to)] charRange 'a' 'd' -- ['a','b','c','d'] : List Char
Edit, from Elm 0.18 and higher, List.range is finally a function:
charRange : Char -> Char -> List Char charRange from to = List.map Char.fromCode <| List.range (Char.toCode from) (Char.toCode to)
Andreas Hultgren
source share