Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module defines codes for the names of the principal subdivisions for the United States according to ISO 3166-2:US.
- data StateCode
- allNames :: [(StateCode, Text)]
- allStates :: [(Text, StateCode)]
- stateList :: [(Text, StateCode)]
- districtList :: [(Text, StateCode)]
- outlyingAreasList :: [(Text, StateCode)]
- fromMName :: Text -> Maybe StateCode
- fromMText :: Text -> Maybe StateCode
- fromName :: Text -> StateCode
- fromText :: Text -> StateCode
- toName :: StateCode -> Text
- toText :: StateCode -> Text
Documentation
AL | Alabama |
AK | Alaska |
AZ | Arizona |
AR | Arkansas |
CA | California |
CO | Colorado |
CT | Connecticut |
DE | Delaware |
FL | Florida |
GA | Georgia |
HI | Hawaii |
ID | Idaho |
IL | Illinois |
IN | Indiana |
IA | Iowa |
KS | Kansas |
KY | Kentucky |
LA | Louisiana |
ME | Maine |
MD | Maryland |
MA | Massachusetts |
MI | Michigan |
MN | Minnesota |
MS | Mississippi |
MO | Missouri |
MT | Montana |
NE | Nebraska |
NV | Nevada |
NH | New Hampshire |
NJ | New Jersey |
NM | New Mexico |
NY | New York |
NC | North Carolina |
ND | North Dakota |
OH | Ohio |
OK | Oklahoma |
OR | Oregon |
PA | Pennsylvania |
RI | Rhode Island |
SC | South Carolina |
SD | South Dakota |
TN | Tennessee |
TX | Texas |
UT | Utah |
VT | Vermont |
VA | Virginia |
WA | Washington |
WV | West Virginia |
WI | Wisconsin |
WY | Wyoming |
DC | District of Columbia |
AS | American Samoa |
GU | Guam |
MP | Northern Mariana Islands |
PR | Puerto Rico |
UM | United States Minor Outlying Islands |
VI | Virgin Islands, U.S. |
Bounded StateCode Source # | |
Enum StateCode Source # | |
Eq StateCode Source # | |
Ord StateCode Source # | |
Read StateCode Source # | |
Show StateCode Source # | |
ToJSON StateCode Source # | To JSON: as a simple string |
FromJSON StateCode Source # | From JSON: as a simple string |
RenderMessage master StateCode Source # | Show state readable name, in English (ignoring locale for now) |
allStates :: [(Text, StateCode)] Source #
List all states with codes. This is ready to be used in a yesod selectField, for example
stateList :: [(Text, StateCode)] Source #
List of states sorted by alphabetical order, with state code this is ready to be used in a yesod selectField, for example
districtList :: [(Text, StateCode)] Source #
List of districts sorted by alphabetical order, with state code this is ready to be used in a yesod selectField, for example
outlyingAreasList :: [(Text, StateCode)] Source #
List of outlying areas sorted by alphabetical order, with state code this is ready to be used in a yesod selectField, for example
fromName :: Text -> StateCode Source #
Get the state code from the state readable name. Errors if the name is unknown