{-# LANGUAGE OverloadedStrings #-}

module Fake.Provider.PhoneNumber.EN_US where

------------------------------------------------------------------------------
import           Data.Text (Text)
import qualified Data.Text as T
import           Text.Printf
------------------------------------------------------------------------------
import           Fake.Combinators
import           Fake.Types
import           Fake.Utils
------------------------------------------------------------------------------

------------------------------------------------------------------------------
-- | Generates US style phone numbers.
phoneNumber :: FGen Text
phoneNumber :: FGen Text
phoneNumber = do
    Text
area <- FGen Text
areaCode
    Text
exch <- FGen Text
exchangeCode
    Text
suff <- NumberScheme -> FGen Text
fakeNumberScheme (NumberScheme -> FGen Text) -> NumberScheme -> FGen Text
forall a b. (a -> b) -> a -> b
$ Text -> NumberScheme
NumberScheme Text
"####"
    let fmt :: String -> Text
fmt String
f = String -> Text
T.pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ String -> Text -> Text -> Text -> String
forall r. PrintfType r => String -> r
printf String
f Text
area Text
exch Text
suff
    [Text] -> FGen Text
forall a. [a] -> FGen a
elements ([Text] -> FGen Text) -> [Text] -> FGen Text
forall a b. (a -> b) -> a -> b
$ (String -> Text) -> [String] -> [Text]
forall a b. (a -> b) -> [a] -> [b]
map String -> Text
fmt [String
"(%s) %s-%s", String
"%s-%s-%s"]

areaCode :: FGen Text
areaCode :: FGen Text
areaCode = [Text] -> FGen Text
forall a. [a] -> FGen a
elements [Text
"201", Text
"202", Text
"203", Text
"205", Text
"206", Text
"207", Text
"208", Text
"209", Text
"210", Text
"212", Text
"213", Text
"214", Text
"215", Text
"216", Text
"217", Text
"218", Text
"219", Text
"224", Text
"225", Text
"226", Text
"228", Text
"229", Text
"231", Text
"234", Text
"239", Text
"240", Text
"248", Text
"251", Text
"252", Text
"253", Text
"254", Text
"256", Text
"260", Text
"262", Text
"267", Text
"269", Text
"270", Text
"276", Text
"281", Text
"301", Text
"302", Text
"303", Text
"304", Text
"305", Text
"307", Text
"308", Text
"309", Text
"310", Text
"312", Text
"313", Text
"314", Text
"315", Text
"316", Text
"317", Text
"318", Text
"319", Text
"320", Text
"321", Text
"323", Text
"330", Text
"334", Text
"336", Text
"337", Text
"339", Text
"347", Text
"351", Text
"352", Text
"360", Text
"361", Text
"386", Text
"401", Text
"402", Text
"404", Text
"405", Text
"406", Text
"407", Text
"408", Text
"409", Text
"410", Text
"412", Text
"413", Text
"414", Text
"415", Text
"417", Text
"419", Text
"423", Text
"424", Text
"425", Text
"434", Text
"435", Text
"440", Text
"443", Text
"469", Text
"478", Text
"479", Text
"480", Text
"484", Text
"501", Text
"502", Text
"503", Text
"504", Text
"505", Text
"507", Text
"508", Text
"509", Text
"510", Text
"512", Text
"513", Text
"515", Text
"516", Text
"517", Text
"518", Text
"520", Text
"530", Text
"540", Text
"541", Text
"551", Text
"559", Text
"561", Text
"562", Text
"563", Text
"567", Text
"570", Text
"571", Text
"573", Text
"574", Text
"580", Text
"585", Text
"586", Text
"601", Text
"602", Text
"603", Text
"605", Text
"606", Text
"607", Text
"608", Text
"609", Text
"610", Text
"612", Text
"614", Text
"615", Text
"616", Text
"617", Text
"618", Text
"619", Text
"620", Text
"623", Text
"626", Text
"630", Text
"631", Text
"636", Text
"641", Text
"646", Text
"650", Text
"651", Text
"660", Text
"661", Text
"662", Text
"678", Text
"682", Text
"701", Text
"702", Text
"703", Text
"704", Text
"706", Text
"707", Text
"708", Text
"712", Text
"713", Text
"714", Text
"715", Text
"716", Text
"717", Text
"718", Text
"719", Text
"720", Text
"724", Text
"727", Text
"731", Text
"732", Text
"734", Text
"740", Text
"754", Text
"757", Text
"760", Text
"763", Text
"765", Text
"770", Text
"772", Text
"773", Text
"774", Text
"775", Text
"781", Text
"785", Text
"786", Text
"801", Text
"802", Text
"803", Text
"804", Text
"805", Text
"806", Text
"808", Text
"810", Text
"812", Text
"813", Text
"814", Text
"815", Text
"816", Text
"817", Text
"818", Text
"828", Text
"830", Text
"831", Text
"832", Text
"843", Text
"845", Text
"847", Text
"848", Text
"850", Text
"856", Text
"857", Text
"858", Text
"859", Text
"860", Text
"862", Text
"863", Text
"864", Text
"865", Text
"870", Text
"878", Text
"901", Text
"903", Text
"904", Text
"906", Text
"907", Text
"908", Text
"909", Text
"910", Text
"912", Text
"913", Text
"914", Text
"915", Text
"916", Text
"917", Text
"918", Text
"919", Text
"920", Text
"925", Text
"928", Text
"931", Text
"936", Text
"937", Text
"940", Text
"941", Text
"947", Text
"949", Text
"952", Text
"954", Text
"956", Text
"970", Text
"971", Text
"972", Text
"973", Text
"978", Text
"979", Text
"980", Text
"985", Text
"989"]

exchangeCode :: FGen Text
exchangeCode :: FGen Text
exchangeCode = [Text] -> FGen Text
forall a. [a] -> FGen a
elements [Text
"201", Text
"202", Text
"203", Text
"205", Text
"206", Text
"207", Text
"208", Text
"209", Text
"210", Text
"212", Text
"213", Text
"214", Text
"215", Text
"216", Text
"217", Text
"218", Text
"219", Text
"224", Text
"225", Text
"227", Text
"228", Text
"229", Text
"231", Text
"234", Text
"239", Text
"240", Text
"248", Text
"251", Text
"252", Text
"253", Text
"254", Text
"256", Text
"260", Text
"262", Text
"267", Text
"269", Text
"270", Text
"276", Text
"281", Text
"283", Text
"301", Text
"302", Text
"303", Text
"304", Text
"305", Text
"307", Text
"308", Text
"309", Text
"310", Text
"312", Text
"313", Text
"314", Text
"315", Text
"316", Text
"317", Text
"318", Text
"319", Text
"320", Text
"321", Text
"323", Text
"330", Text
"331", Text
"334", Text
"336", Text
"337", Text
"339", Text
"347", Text
"351", Text
"352", Text
"360", Text
"361", Text
"386", Text
"401", Text
"402", Text
"404", Text
"405", Text
"406", Text
"407", Text
"408", Text
"409", Text
"410", Text
"412", Text
"413", Text
"414", Text
"415", Text
"417", Text
"419", Text
"423", Text
"424", Text
"425", Text
"434", Text
"435", Text
"440", Text
"443", Text
"445", Text
"464", Text
"469", Text
"470", Text
"475", Text
"478", Text
"479", Text
"480", Text
"484", Text
"501", Text
"502", Text
"503", Text
"504", Text
"505", Text
"507", Text
"508", Text
"509", Text
"510", Text
"512", Text
"513", Text
"515", Text
"516", Text
"517", Text
"518", Text
"520", Text
"530", Text
"540", Text
"541", Text
"551", Text
"557", Text
"559", Text
"561", Text
"562", Text
"563", Text
"564", Text
"567", Text
"570", Text
"571", Text
"573", Text
"574", Text
"580", Text
"585", Text
"586", Text
"601", Text
"602", Text
"603", Text
"605", Text
"606", Text
"607", Text
"608", Text
"609", Text
"610", Text
"612", Text
"614", Text
"615", Text
"616", Text
"617", Text
"618", Text
"619", Text
"620", Text
"623", Text
"626", Text
"630", Text
"631", Text
"636", Text
"641", Text
"646", Text
"650", Text
"651", Text
"660", Text
"661", Text
"662", Text
"667", Text
"678", Text
"682", Text
"701", Text
"702", Text
"703", Text
"704", Text
"706", Text
"707", Text
"708", Text
"712", Text
"713", Text
"714", Text
"715", Text
"716", Text
"717", Text
"718", Text
"719", Text
"720", Text
"724", Text
"727", Text
"731", Text
"732", Text
"734", Text
"737", Text
"740", Text
"754", Text
"757", Text
"760", Text
"763", Text
"765", Text
"770", Text
"772", Text
"773", Text
"774", Text
"775", Text
"781", Text
"785", Text
"786", Text
"801", Text
"802", Text
"803", Text
"804", Text
"805", Text
"806", Text
"808", Text
"810", Text
"812", Text
"813", Text
"814", Text
"815", Text
"816", Text
"817", Text
"818", Text
"828", Text
"830", Text
"831", Text
"832", Text
"835", Text
"843", Text
"845", Text
"847", Text
"848", Text
"850", Text
"856", Text
"857", Text
"858", Text
"859", Text
"860", Text
"862", Text
"863", Text
"864", Text
"865", Text
"870", Text
"872", Text
"878", Text
"901", Text
"903", Text
"904", Text
"906", Text
"907", Text
"908", Text
"909", Text
"910", Text
"912", Text
"913", Text
"914", Text
"915", Text
"916", Text
"917", Text
"918", Text
"919", Text
"920", Text
"925", Text
"928", Text
"931", Text
"936", Text
"937", Text
"940", Text
"941", Text
"947", Text
"949", Text
"952", Text
"954", Text
"956", Text
"959", Text
"970", Text
"971", Text
"972", Text
"973", Text
"975", Text
"978", Text
"979", Text
"980", Text
"984", Text
"985", Text
"989"]