2018-06-06 01:39:57 +03:00
|
|
|
-- Copyright (c) 2016-present, Facebook, Inc.
|
|
|
|
-- All rights reserved.
|
|
|
|
--
|
|
|
|
-- This source code is licensed under the BSD-style license found in the
|
2019-05-22 20:36:43 +03:00
|
|
|
-- LICENSE file in the root directory of this source tree.
|
2018-06-06 01:39:57 +03:00
|
|
|
|
|
|
|
|
|
|
|
{-# LANGUAGE DeriveAnyClass #-}
|
|
|
|
{-# LANGUAGE DeriveGeneric #-}
|
|
|
|
{-# LANGUAGE NoRebindableSyntax #-}
|
|
|
|
|
|
|
|
module Duckling.Region
|
|
|
|
( Region(..)
|
|
|
|
) where
|
|
|
|
|
|
|
|
import Data.Hashable
|
|
|
|
import GHC.Generics
|
|
|
|
import Prelude
|
|
|
|
import TextShow (TextShow)
|
|
|
|
import qualified TextShow as TS
|
|
|
|
|
|
|
|
-- | ISO 3166-1 alpha-2 Country code (includes regions and territories).
|
|
|
|
-- See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
|
|
|
data Region
|
2020-02-26 02:44:17 +03:00
|
|
|
= AR
|
|
|
|
| AU
|
2018-06-06 01:39:57 +03:00
|
|
|
| BE
|
|
|
|
| BZ
|
|
|
|
| CA
|
2020-02-26 02:44:17 +03:00
|
|
|
| CL
|
2018-06-06 01:39:57 +03:00
|
|
|
| CN
|
2020-02-26 02:44:17 +03:00
|
|
|
| CO
|
2020-12-15 22:19:08 +03:00
|
|
|
| EG
|
2020-02-26 02:44:17 +03:00
|
|
|
| ES
|
2018-06-06 01:39:57 +03:00
|
|
|
| GB
|
|
|
|
| HK
|
|
|
|
| IE
|
|
|
|
| IN
|
|
|
|
| JM
|
2018-11-27 02:16:43 +03:00
|
|
|
| MN
|
2020-02-26 02:44:17 +03:00
|
|
|
| MX
|
2018-06-06 01:39:57 +03:00
|
|
|
| MO
|
|
|
|
| NL
|
|
|
|
| NZ
|
2020-02-26 02:44:17 +03:00
|
|
|
| PE
|
2018-06-06 01:39:57 +03:00
|
|
|
| PH
|
|
|
|
| TT
|
|
|
|
| TW
|
|
|
|
| US
|
2020-02-26 02:44:17 +03:00
|
|
|
| VE
|
2018-06-06 01:39:57 +03:00
|
|
|
| ZA
|
|
|
|
deriving (Bounded, Enum, Eq, Generic, Hashable, Ord, Read, Show)
|
|
|
|
|
|
|
|
instance TextShow Region where
|
|
|
|
showb = TS.fromString . show
|