| Safe Haskell | Safe-Inferred | 
|---|---|
| Language | Haskell2010 | 
Data.PhoneNumber.Number
Description
Data fields of PhoneNumber objects.
Synopsis
- data PhoneNumber
- pattern PhoneNumber :: Maybe ByteString -> Maybe ByteString -> Maybe ByteString -> Word -> CountryCode -> Maybe Bool -> Maybe CountryCodeSource -> Maybe Int -> PhoneNumber
- extension :: PhoneNumber -> Maybe ByteString
- rawInput :: PhoneNumber -> Maybe ByteString
- preferredDomesticCarrierCode :: PhoneNumber -> Maybe ByteString
- nationalNumber :: PhoneNumber -> Word
- countryCode :: PhoneNumber -> CountryCode
- italianLeadingZero :: PhoneNumber -> Maybe Bool
- countryCodeSource :: PhoneNumber -> Maybe CountryCodeSource
- numberOfLeadingZeros :: PhoneNumber -> Maybe Int
- newtype CountryCode = CountryCode Int
- data CountryCodeSource
Documentation
data PhoneNumber Source #
A decoded phone number. While internally it is a handle for the
 corresponding C++ object, for most intents and purposes it can be used as
 a record (using the PhoneNumber record pattern
 synonym) with the following structure:
PhoneNumber{extension:: !(MaybeByteString) ,rawInput:: !(MaybeByteString) ,preferredDomesticCarrierCode:: !(MaybeByteString) ,nationalNumber:: !Word,countryCode:: !CountryCode,italianLeadingZero:: !(MaybeBool) ,countryCodeSource:: !(MaybeCountryCodeSource) ,numberOfLeadingZeros:: !(MaybeInt) }
Instances
pattern PhoneNumber :: Maybe ByteString -> Maybe ByteString -> Maybe ByteString -> Word -> CountryCode -> Maybe Bool -> Maybe CountryCodeSource -> Maybe Int -> PhoneNumber Source #
Record pattern synonym for accessing data fields of the underlying C++
 object. It can be used for record construction, record update, and record
 pattern match. See PhoneNumber.
extension :: PhoneNumber -> Maybe ByteString Source #
E.g.:
parseNumberCanonicalizeNothing"+1 800-234-5678 ext. 1234" =RightPhoneNumber{extension=Just"1234", .. }
rawInput :: PhoneNumber -> Maybe ByteString Source #
E.g.:
parseNumberKeepRawInputNothing" + 1(2-3~4*5.6 " =RightPhoneNumber{rawInput=Just" + 1(2-3~4*5.6 ", .. }
preferredDomesticCarrierCode :: PhoneNumber -> Maybe ByteString Source #
E.g.:
parseNumberKeepRawInput(Just"BR") "0 41 (21) 2345-6789" =RightPhoneNumber{preferredDomesticCarrierCode=Just"41", .. }
nationalNumber :: PhoneNumber -> Word Source #
You probably want to use nationalSignificantNumber
 instead. E.g.:
parseNumberCanonicalizeNothing"+800 0001 2345" =RightPhoneNumber{nationalNumber= 12345,numberOfLeadingZeros= Just 3, .. }
countryCode :: PhoneNumber -> CountryCode Source #
E.g.:
parseNumberCanonicalize(Just"US") "800-234-5678" =RightPhoneNumber{countryCode= 1, .. }
italianLeadingZero :: PhoneNumber -> Maybe Bool Source #
E.g.:
parseNumberCanonicalizeNothing"+39 06 1234 5678" =RightPhoneNumber{italianLeadingZero=JustTrue, .. }
countryCodeSource :: PhoneNumber -> Maybe CountryCodeSource Source #
E.g.:
parseNumberKeepRawInput(Just"US") "011 800 1234 5678" =RightPhoneNumber{countryCodeSource=JustFromNumberWithIdd, .. }
numberOfLeadingZeros :: PhoneNumber -> Maybe Int Source #
E.g.:
parseNumberCanonicalizeNothing"+800 0001 2345" =RightPhoneNumber{numberOfLeadingZeros= Just 3,nationalNumber= 12345, .. }
newtype CountryCode Source #
A country calling code (International Subscriber Dialing code, ISD code),
 e.g. 34 for Spain.
Contrary to the name, doesn't always correspond to a unique country (e.g.
 7 could be either Russia or Kazakhstan), or a country at all, and instead a
 non-geographical entity (e.g. 800 is a Universal International Freephone
 Service dialing code).
Constructors
| CountryCode Int | 
Instances
| Num CountryCode Source # | |
| Defined in Data.PhoneNumber.Number Methods (+) :: CountryCode -> CountryCode -> CountryCode # (-) :: CountryCode -> CountryCode -> CountryCode # (*) :: CountryCode -> CountryCode -> CountryCode # negate :: CountryCode -> CountryCode # abs :: CountryCode -> CountryCode # signum :: CountryCode -> CountryCode # fromInteger :: Integer -> CountryCode # | |
| Show CountryCode Source # | |
| Defined in Data.PhoneNumber.Number Methods showsPrec :: Int -> CountryCode -> ShowS # show :: CountryCode -> String # showList :: [CountryCode] -> ShowS # | |
| Eq CountryCode Source # | |
| Defined in Data.PhoneNumber.Number | |
| Ord CountryCode Source # | |
| Defined in Data.PhoneNumber.Number Methods compare :: CountryCode -> CountryCode -> Ordering # (<) :: CountryCode -> CountryCode -> Bool # (<=) :: CountryCode -> CountryCode -> Bool # (>) :: CountryCode -> CountryCode -> Bool # (>=) :: CountryCode -> CountryCode -> Bool # max :: CountryCode -> CountryCode -> CountryCode # min :: CountryCode -> CountryCode -> CountryCode # | |
data CountryCodeSource Source #
Indicates what information was used to fill the
 countryCode field of PhoneNumber.
Constructors
| Unspecified | |
| FromNumberWithPlusSign | |
| FromNumberWithIdd | |
| FromNumberWithoutPlusSign | |
| FromDefaultCountry |