{-# OPTIONS -Wno-deprecations #-}
module Data.Standards.ISO.Country.Primary.Translation
( alpha2ToAlpha3
, alpha2ToNumeric
, alpha3ToAlpha2
, alpha3ToNumeric
, numericToAlpha2
, numericToAlpha3
) where
import qualified Data.Standards.ISO.Country.Primary.Alpha2 as A2
import qualified Data.Standards.ISO.Country.Primary.Alpha3 as A3
import qualified Data.Standards.ISO.Country.Primary.Numeric as N
import qualified Data.HashMap.Lazy as M
import qualified Data.Maybe as Y
alpha2ToAlpha3 :: A2.Alpha2 -> Maybe A3.Alpha3
alpha2ToAlpha3 = flip M.lookup a2a3
alpha2ToNumeric :: A2.Alpha2 -> Maybe N.Numeric
alpha2ToNumeric = flip M.lookup a2n
alpha3ToAlpha2 :: A3.Alpha3 -> Maybe A2.Alpha2
alpha3ToAlpha2 = flip M.lookup a3a2
alpha3ToNumeric :: A3.Alpha3 -> Maybe N.Numeric
alpha3ToNumeric = flip M.lookup a3n
numericToAlpha2 :: N.Numeric -> Maybe A2.Alpha2
numericToAlpha2 = flip M.lookup na2
numericToAlpha3 :: N.Numeric -> Maybe A3.Alpha3
numericToAlpha3 = flip M.lookup na3
tuples :: [(Maybe A2.Alpha2, Maybe A3.Alpha3, Maybe N.Numeric)]
tuples =
[ (Just A2.AC, Just A3.ASC, Nothing )
, (Just A2.AD, Just A3.AND, Just N.C020)
, (Just A2.AE, Just A3.ARE, Just N.C784)
, (Just A2.AF, Just A3.AFG, Just N.C004)
, (Just A2.AG, Just A3.ATG, Just N.C028)
, (Just A2.AI, Just A3.AIA, Just N.C660)
, (Just A2.AL, Just A3.ALB, Just N.C008)
, (Just A2.AM, Just A3.ARM, Just N.C051)
, (Just A2.AN, Just A3.ANT, Just N.C530)
, (Just A2.AO, Just A3.AGO, Just N.C024)
, (Just A2.AQ, Just A3.ATA, Just N.C010)
, (Just A2.AR, Just A3.ARG, Just N.C032)
, (Just A2.AS, Just A3.ASM, Just N.C016)
, (Just A2.AT, Just A3.AUT, Just N.C040)
, (Just A2.AU, Just A3.AUS, Just N.C036)
, (Just A2.AW, Just A3.ABW, Just N.C533)
, (Just A2.AX, Just A3.ALA, Just N.C248)
, (Just A2.AZ, Just A3.AZE, Just N.C031)
, (Just A2.BA, Just A3.BIH, Just N.C070)
, (Just A2.BB, Just A3.BRB, Just N.C052)
, (Just A2.BD, Just A3.BGD, Just N.C050)
, (Just A2.BE, Just A3.BEL, Just N.C056)
, (Just A2.BF, Just A3.BFA, Just N.C854)
, (Just A2.BG, Just A3.BGR, Just N.C100)
, (Just A2.BH, Just A3.BHR, Just N.C048)
, (Just A2.BI, Just A3.BDI, Just N.C108)
, (Just A2.BJ, Just A3.BEN, Just N.C204)
, (Just A2.BL, Just A3.BLM, Just N.C652)
, (Just A2.BM, Just A3.BMU, Just N.C060)
, (Just A2.BN, Just A3.BRN, Just N.C096)
, (Just A2.BO, Just A3.BOL, Just N.C068)
, (Nothing , Just A3.ATB, Just N.C080)
, (Just A2.BQ, Just A3.BES, Just N.C535)
, (Just A2.BR, Just A3.BRA, Just N.C076)
, (Just A2.BS, Just A3.BHS, Just N.C044)
, (Just A2.BT, Just A3.BTN, Just N.C064)
, (Just A2.BU, Just A3.BUR, Nothing )
, (Just A2.BV, Just A3.BVT, Just N.C074)
, (Just A2.BW, Just A3.BWA, Just N.C072)
, (Just A2.BY, Just A3.BLR, Just N.C112)
, (Just A2.BZ, Just A3.BLZ, Just N.C084)
, (Just A2.CA, Just A3.CAN, Just N.C124)
, (Just A2.CC, Just A3.CCK, Just N.C166)
, (Just A2.CD, Just A3.COD, Just N.C180)
, (Just A2.CF, Just A3.CAF, Just N.C140)
, (Just A2.CG, Just A3.COG, Just N.C178)
, (Just A2.CH, Just A3.CHE, Just N.C756)
, (Just A2.CI, Just A3.CIV, Just N.C384)
, (Just A2.CK, Just A3.COK, Just N.C184)
, (Just A2.CL, Just A3.CHL, Just N.C152)
, (Just A2.CM, Just A3.CMR, Just N.C120)
, (Just A2.CN, Just A3.CHN, Just N.C156)
, (Just A2.CO, Just A3.COL, Just N.C170)
, (Just A2.CP, Just A3.CPT, Nothing )
, (Just A2.CR, Just A3.CRI, Just N.C188)
, (Nothing , Just A3.CSK, Just N.C200)
, (Just A2.CS, Just A3.SCG, Just N.C891)
, (Just A2.CT, Just A3.CTE, Just N.C128)
, (Just A2.CU, Just A3.CUB, Just N.C192)
, (Just A2.CV, Just A3.CPV, Just N.C132)
, (Just A2.CW, Just A3.CUW, Just N.C531)
, (Just A2.CX, Just A3.CXR, Just N.C162)
, (Just A2.CY, Just A3.CYP, Just N.C196)
, (Just A2.CZ, Just A3.CZE, Just N.C203)
, (Just A2.DD, Just A3.DDR, Just N.C278)
, (Just A2.DE, Just A3.DEU, Just N.C276)
, (Just A2.DG, Just A3.DGA, Nothing )
, (Just A2.DJ, Just A3.DJI, Just N.C262)
, (Just A2.DK, Just A3.DNK, Just N.C208)
, (Just A2.DM, Just A3.DMA, Just N.C212)
, (Just A2.DO, Just A3.DOM, Just N.C214)
, (Just A2.DZ, Just A3.DZA, Just N.C012)
, (Just A2.EA, Nothing , Nothing )
, (Just A2.EC, Just A3.ECU, Just N.C218)
, (Just A2.EE, Just A3.EST, Just N.C233)
, (Just A2.EG, Just A3.EGY, Just N.C818)
, (Just A2.EH, Just A3.ESH, Just N.C732)
, (Just A2.ER, Just A3.ERI, Just N.C232)
, (Just A2.ES, Just A3.ESP, Just N.C724)
, (Just A2.ET, Just A3.ETH, Just N.C231)
, (Just A2.EU, Nothing , Nothing )
, (Just A2.EZ, Nothing , Nothing )
, (Just A2.FI, Just A3.FIN, Just N.C246)
, (Just A2.FJ, Just A3.FJI, Just N.C242)
, (Just A2.FK, Just A3.FLK, Just N.C238)
, (Just A2.FM, Just A3.FSM, Just N.C583)
, (Just A2.FO, Just A3.FRO, Just N.C234)
, (Just A2.FR, Just A3.FRA, Just N.C250)
, (Just A2.FX, Just A3.FXX, Just N.C249)
, (Just A2.GA, Just A3.GAB, Just N.C266)
, (Just A2.GB, Just A3.GBR, Just N.C826)
, (Just A2.GD, Just A3.GRD, Just N.C308)
, (Just A2.GE, Just A3.GEO, Just N.C268)
, (Just A2.GF, Just A3.GUF, Just N.C254)
, (Just A2.GG, Just A3.GGY, Just N.C831)
, (Just A2.GH, Just A3.GHA, Just N.C288)
, (Just A2.GI, Just A3.GIB, Just N.C292)
, (Just A2.GL, Just A3.GRL, Just N.C304)
, (Just A2.GM, Just A3.GMB, Just N.C270)
, (Just A2.GN, Just A3.GIN, Just N.C324)
, (Just A2.GP, Just A3.GLP, Just N.C312)
, (Just A2.GQ, Just A3.GNQ, Just N.C226)
, (Just A2.GR, Just A3.GRC, Just N.C300)
, (Just A2.GS, Just A3.SGS, Just N.C239)
, (Just A2.GT, Just A3.GTM, Just N.C320)
, (Just A2.GU, Just A3.GUM, Just N.C316)
, (Just A2.GW, Just A3.GNB, Just N.C624)
, (Just A2.GY, Just A3.GUY, Just N.C328)
, (Just A2.HK, Just A3.HKG, Just N.C344)
, (Just A2.HM, Just A3.HMD, Just N.C334)
, (Just A2.HN, Just A3.HND, Just N.C340)
, (Just A2.HR, Just A3.HRV, Just N.C191)
, (Just A2.HT, Just A3.HTI, Just N.C332)
, (Just A2.HU, Just A3.HUN, Just N.C348)
, (Just A2.HV, Just A3.HVO, Nothing )
, (Just A2.IC, Nothing , Nothing )
, (Just A2.ID, Just A3.IDN, Just N.C360)
, (Just A2.IE, Just A3.IRL, Just N.C372)
, (Just A2.IL, Just A3.ISR, Just N.C376)
, (Just A2.IM, Just A3.IMN, Just N.C833)
, (Just A2.IN, Just A3.IND, Just N.C356)
, (Just A2.IO, Just A3.IOT, Just N.C086)
, (Just A2.IQ, Just A3.IRQ, Just N.C368)
, (Just A2.IR, Just A3.IRN, Just N.C364)
, (Just A2.IS, Just A3.ISL, Just N.C352)
, (Just A2.IT, Just A3.ITA, Just N.C380)
, (Just A2.JE, Just A3.JEY, Just N.C832)
, (Just A2.JM, Just A3.JAM, Just N.C388)
, (Just A2.JO, Just A3.JOR, Just N.C400)
, (Just A2.JP, Just A3.JPN, Just N.C392)
, (Just A2.JT, Just A3.JTN, Just N.C396)
, (Just A2.KE, Just A3.KEN, Just N.C404)
, (Just A2.KG, Just A3.KGZ, Just N.C417)
, (Just A2.KH, Just A3.KHM, Just N.C116)
, (Just A2.KI, Just A3.KIR, Just N.C296)
, (Just A2.KM, Just A3.COM, Just N.C174)
, (Just A2.KN, Just A3.KNA, Just N.C659)
, (Just A2.KP, Just A3.PRK, Just N.C408)
, (Just A2.KR, Just A3.KOR, Just N.C410)
, (Just A2.KW, Just A3.KWT, Just N.C414)
, (Just A2.KY, Just A3.CYM, Just N.C136)
, (Just A2.KZ, Just A3.KAZ, Just N.C398)
, (Just A2.LA, Just A3.LAO, Just N.C418)
, (Just A2.LB, Just A3.LBN, Just N.C422)
, (Just A2.LC, Just A3.LCA, Just N.C662)
, (Just A2.LI, Just A3.LIE, Just N.C438)
, (Just A2.LK, Just A3.LKA, Just N.C144)
, (Just A2.LR, Just A3.LBR, Just N.C430)
, (Just A2.LS, Just A3.LSO, Just N.C426)
, (Just A2.LT, Just A3.LTU, Just N.C440)
, (Just A2.LU, Just A3.LUX, Just N.C442)
, (Just A2.LV, Just A3.LVA, Just N.C428)
, (Just A2.LY, Just A3.LBY, Just N.C434)
, (Just A2.MA, Just A3.MAR, Just N.C504)
, (Just A2.MC, Just A3.MCO, Just N.C492)
, (Just A2.MD, Just A3.MDA, Just N.C498)
, (Just A2.ME, Just A3.MNE, Just N.C499)
, (Just A2.MF, Just A3.MAF, Just N.C663)
, (Just A2.MG, Just A3.MDG, Just N.C450)
, (Just A2.MH, Just A3.MHL, Just N.C584)
, (Just A2.MI, Just A3.MID, Just N.C488)
, (Just A2.MK, Just A3.MKD, Just N.C807)
, (Just A2.ML, Just A3.MLI, Just N.C466)
, (Just A2.MM, Just A3.MMR, Just N.C104)
, (Just A2.MN, Just A3.MNG, Just N.C496)
, (Just A2.MO, Just A3.MAC, Just N.C446)
, (Just A2.MP, Just A3.MNP, Just N.C580)
, (Just A2.MQ, Just A3.MTQ, Just N.C474)
, (Just A2.MR, Just A3.MRT, Just N.C478)
, (Just A2.MS, Just A3.MSR, Just N.C500)
, (Just A2.MT, Just A3.MLT, Just N.C470)
, (Just A2.MU, Just A3.MUS, Just N.C480)
, (Just A2.MV, Just A3.MDV, Just N.C462)
, (Just A2.MW, Just A3.MWI, Just N.C454)
, (Just A2.MX, Just A3.MEX, Just N.C484)
, (Just A2.MY, Just A3.MYS, Just N.C458)
, (Just A2.MZ, Just A3.MOZ, Just N.C508)
, (Just A2.NA, Just A3.NAM, Just N.C516)
, (Just A2.NC, Just A3.NCL, Just N.C540)
, (Just A2.NE, Just A3.NER, Just N.C562)
, (Just A2.NF, Just A3.NFK, Just N.C574)
, (Just A2.NG, Just A3.NGA, Just N.C566)
, (Just A2.NH, Just A3.NHB, Nothing )
, (Just A2.NI, Just A3.NIC, Just N.C558)
, (Just A2.NL, Just A3.NLD, Just N.C528)
, (Just A2.NO, Just A3.NOR, Just N.C578)
, (Just A2.NP, Just A3.NPL, Just N.C524)
, (Just A2.NQ, Just A3.ATN, Just N.C216)
, (Just A2.NR, Just A3.NRU, Just N.C520)
, (Just A2.NT, Just A3.NTZ, Just N.C536)
, (Just A2.NU, Just A3.NIU, Just N.C570)
, (Just A2.NZ, Just A3.NZL, Just N.C554)
, (Just A2.OM, Just A3.OMN, Just N.C512)
, (Just A2.PA, Just A3.PAN, Just N.C591)
, (Just A2.PC, Just A3.PCI, Just N.C582)
, (Just A2.PE, Just A3.PER, Just N.C604)
, (Just A2.PF, Just A3.PYF, Just N.C258)
, (Just A2.PG, Just A3.PNG, Just N.C598)
, (Just A2.PH, Just A3.PHL, Just N.C608)
, (Just A2.PK, Just A3.PAK, Just N.C586)
, (Just A2.PL, Just A3.POL, Just N.C616)
, (Just A2.PM, Just A3.SPM, Just N.C666)
, (Just A2.PN, Just A3.PCN, Just N.C612)
, (Just A2.PR, Just A3.PRI, Just N.C630)
, (Just A2.PS, Just A3.PSE, Just N.C275)
, (Just A2.PT, Just A3.PRT, Just N.C620)
, (Just A2.PU, Just A3.PUS, Just N.C849)
, (Just A2.PW, Just A3.PLW, Just N.C585)
, (Just A2.PY, Just A3.PRY, Just N.C600)
, (Just A2.PZ, Just A3.PCZ, Just N.C594)
, (Just A2.QA, Just A3.QAT, Just N.C634)
, (Just A2.RE, Just A3.REU, Just N.C638)
, (Just A2.RO, Just A3.ROU, Just N.C642)
, (Just A2.RS, Just A3.SRB, Just N.C688)
, (Just A2.RU, Just A3.RUS, Just N.C643)
, (Just A2.RW, Just A3.RWA, Just N.C646)
, (Just A2.SA, Just A3.SAU, Just N.C682)
, (Just A2.SB, Just A3.SLB, Just N.C090)
, (Just A2.SC, Just A3.SYC, Just N.C690)
, (Just A2.SD, Just A3.SDN, Just N.C729)
, (Just A2.SE, Just A3.SWE, Just N.C752)
, (Just A2.SG, Just A3.SGP, Just N.C702)
, (Just A2.SH, Just A3.SHN, Just N.C654)
, (Just A2.SI, Just A3.SVN, Just N.C705)
, (Just A2.SJ, Just A3.SJM, Just N.C744)
, (Nothing , Just A3.SKM, Just N.C698)
, (Just A2.SK, Just A3.SVK, Just N.C703)
, (Just A2.SL, Just A3.SLE, Just N.C694)
, (Just A2.SM, Just A3.SMR, Just N.C674)
, (Just A2.SN, Just A3.SEN, Just N.C686)
, (Just A2.SO, Just A3.SOM, Just N.C706)
, (Just A2.SR, Just A3.SUR, Just N.C740)
, (Just A2.SS, Just A3.SSD, Just N.C728)
, (Just A2.ST, Just A3.STP, Just N.C678)
, (Just A2.SV, Just A3.SLV, Just N.C222)
, (Just A2.SU, Just A3.SUN, Just N.C810)
, (Just A2.SX, Just A3.SXM, Just N.C534)
, (Just A2.SY, Just A3.SYR, Just N.C760)
, (Just A2.SZ, Just A3.SWZ, Just N.C748)
, (Just A2.TA, Just A3.TAA, Nothing )
, (Just A2.TC, Just A3.TCA, Just N.C796)
, (Just A2.TD, Just A3.TCD, Just N.C148)
, (Just A2.TF, Just A3.ATF, Just N.C260)
, (Just A2.TG, Just A3.TGO, Just N.C768)
, (Just A2.TH, Just A3.THA, Just N.C764)
, (Just A2.TJ, Just A3.TJK, Just N.C762)
, (Just A2.TK, Just A3.TKL, Just N.C772)
, (Just A2.TL, Just A3.TLS, Just N.C626)
, (Just A2.TM, Just A3.TKM, Just N.C795)
, (Just A2.TN, Just A3.TUN, Just N.C788)
, (Just A2.TO, Just A3.TON, Just N.C776)
, (Just A2.TR, Just A3.TUR, Just N.C792)
, (Just A2.TP, Just A3.TMP, Nothing )
, (Just A2.TT, Just A3.TTO, Just N.C780)
, (Just A2.TV, Just A3.TUV, Just N.C798)
, (Just A2.TW, Just A3.TWN, Just N.C158)
, (Just A2.TZ, Just A3.TZA, Just N.C834)
, (Just A2.UA, Just A3.UKR, Just N.C804)
, (Just A2.UG, Just A3.UGA, Just N.C800)
, (Just A2.UK, Nothing , Nothing )
, (Just A2.UM, Just A3.UMI, Just N.C581)
, (Just A2.UN, Nothing , Nothing )
, (Just A2.US, Just A3.USA, Just N.C840)
, (Just A2.UY, Just A3.URY, Just N.C858)
, (Just A2.UZ, Just A3.UZB, Just N.C860)
, (Just A2.VA, Just A3.VAT, Just N.C336)
, (Just A2.VC, Just A3.VCT, Just N.C670)
, (Just A2.VD, Just A3.VDR, Just N.C714)
, (Just A2.VE, Just A3.VEN, Just N.C862)
, (Just A2.VG, Just A3.VGB, Just N.C092)
, (Just A2.VI, Just A3.VIR, Just N.C850)
, (Just A2.VN, Just A3.VNM, Just N.C704)
, (Just A2.VU, Just A3.VUT, Just N.C548)
, (Just A2.WF, Just A3.WLF, Just N.C876)
, (Just A2.WK, Just A3.WAK, Just N.C872)
, (Just A2.WS, Just A3.WSM, Just N.C882)
, (Just A2.YD, Just A3.YMD, Just N.C720)
, (Just A2.YE, Just A3.YEM, Just N.C887)
, (Just A2.YT, Just A3.MYT, Just N.C175)
, (Just A2.YU, Just A3.YUG, Just N.C890)
, (Just A2.ZA, Just A3.ZAF, Just N.C710)
, (Just A2.ZM, Just A3.ZMB, Just N.C894)
, (Just A2.ZW, Just A3.ZWE, Just N.C716)
, (Just A2.ZR, Just A3.ZAR, Nothing )
]
a2a3 :: M.HashMap A2.Alpha2 A3.Alpha3
a2a3 = M.fromList . flip Y.mapMaybe tuples
$ \(ma2, ma3, _) -> do
a2 <- ma2
a3 <- ma3
return (a2, a3)
a2n :: M.HashMap A2.Alpha2 N.Numeric
a2n = M.fromList . flip Y.mapMaybe tuples
$ \(ma2, _, mn) -> do
a2 <- ma2
n <- mn
return (a2, n)
a3a2 :: M.HashMap A3.Alpha3 A2.Alpha2
a3a2 = M.fromList . flip Y.mapMaybe tuples
$ \(ma2, ma3, _) -> do
a2 <- ma2
a3 <- ma3
return (a3, a2)
a3n :: M.HashMap A3.Alpha3 N.Numeric
a3n = M.fromList . flip Y.mapMaybe tuples
$ \(_, ma3, mn) -> do
a3 <- ma3
n <- mn
return (a3, n)
na2 :: M.HashMap N.Numeric A2.Alpha2
na2 = M.fromList . flip Y.mapMaybe tuples
$ \(ma2, _, mn) -> do
a2 <- ma2
n <- mn
return (n, a2)
na3 :: M.HashMap N.Numeric A3.Alpha3
na3 = M.fromList . flip Y.mapMaybe tuples
$ \(_, ma3, mn) -> do
a3 <- ma3
n <- mn
return (n, a3)