Here are the abbreviations for every US State, as a union type, and two functions to convert to state names as strings.
Every US State abbreviation.
all : List Abbreviation
All the abbreviations as a list
toString : Abbreviation -> String
Get the states name from the abbreviation
UsState.toString AZ == "arizona" -- True
fromString : String -> Maybe Abbreviation
Get the states abbreviation from its name
UsState.fromString "Arizona" == Just AZ -- True
UsState.fromString "Arizona " == Just AZ -- True
UsState.fromString "arizona" == Just AZ -- True
UsState.fromString "puerto rico" == Nothing -- True