| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.BCP47.Internal.Region
Documentation
A country recognized by ISO 3166.
Instances
| Bounded Country | |
| Enum Country | |
| Eq Country | |
| Ord Country | |
Defined in Country.Unexposed.Names | |
| Show Country | |
| Generic Country | |
| Hashable Country | |
Defined in Country.Unexposed.Names | |
| ToJSON Country | |
Defined in Country.Unexposed.Names | |
| FromJSON Country | |
| Storable Country | |
| NFData Country | |
Defined in Country.Unexposed.Names | |
| Prim Country | |
Defined in Country.Unexposed.Names Methods alignment# :: Country -> Int# # indexByteArray# :: ByteArray# -> Int# -> Country # readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (#State# s, Country#) # writeByteArray# :: MutableByteArray# s -> Int# -> Country -> State# s -> State# s # setByteArray# :: MutableByteArray# s -> Int# -> Int# -> Country -> State# s -> State# s # indexOffAddr# :: Addr# -> Int# -> Country # readOffAddr# :: Addr# -> Int# -> State# s -> (#State# s, Country#) # writeOffAddr# :: Addr# -> Int# -> Country -> State# s -> State# s # setOffAddr# :: Addr# -> Int# -> Int# -> Country -> State# s -> State# s # | |
| type Rep Country | |
Defined in Country.Unexposed.Names | |
regionToText :: Country -> Text Source #
regionFromText :: Text -> Either Text Country Source #
Parse a region subtag from Text
>>>regionFromText $ pack "ZW"Right zimbabwe
>>>regionFromText $ pack "012"Right algeria
>>>regionFromText $ pack "asdf"Left "regionFromText:1:1:\n |\n1 | asdf\n | ^\nunexpected 'a'\nexpecting 2 or 3 character country code\n"