ca-province-codes-1.0.0.0: ISO 3166-2:CA Province Codes and Names

Safe HaskellNone
LanguageHaskell2010

Data.CAProvinceCodes

Description

The Data.CAProvinceCodes module is used for enumerating, and rendering the ISO 3166-2:CA codes for Canadian Provinces and Territories.

It is meant to be qualified when imported:

import qualified Data.CAProvinceCodes as CAProvinces
Synopsis

Documentation

data Code Source #

A Canadian Province/Territory Code from ISO 3166-2:CA.

Constructors

AB

Alberta

BC

British Columbia

MB

Manitoba

NB

New Brunswick

NL

Newfoundland And Labrador

NS

Nova Scotia

NT

Northwest Territories

NU

Nunavut

ON

Ontario

PE

Prince Edward Island

QC

Quebec

SK

Saskatchewan

YT

Yukon

Instances
Bounded Code Source # 
Instance details

Defined in Data.CAProvinceCodes

Enum Code Source # 
Instance details

Defined in Data.CAProvinceCodes

Methods

succ :: Code -> Code #

pred :: Code -> Code #

toEnum :: Int -> Code #

fromEnum :: Code -> Int #

enumFrom :: Code -> [Code] #

enumFromThen :: Code -> Code -> [Code] #

enumFromTo :: Code -> Code -> [Code] #

enumFromThenTo :: Code -> Code -> Code -> [Code] #

Eq Code Source # 
Instance details

Defined in Data.CAProvinceCodes

Methods

(==) :: Code -> Code -> Bool #

(/=) :: Code -> Code -> Bool #

Read Code Source # 
Instance details

Defined in Data.CAProvinceCodes

Show Code Source # 
Instance details

Defined in Data.CAProvinceCodes

Methods

showsPrec :: Int -> Code -> ShowS #

show :: Code -> String #

showList :: [Code] -> ShowS #

Generic Code Source # 
Instance details

Defined in Data.CAProvinceCodes

Associated Types

type Rep Code :: Type -> Type #

Methods

from :: Code -> Rep Code x #

to :: Rep Code x -> Code #

ToJSON Code Source # 
Instance details

Defined in Data.CAProvinceCodes

FromJSON Code Source # 
Instance details

Defined in Data.CAProvinceCodes

type Rep Code Source # 
Instance details

Defined in Data.CAProvinceCodes

type Rep Code = D1 (MetaData "Code" "Data.CAProvinceCodes" "ca-province-codes-1.0.0.0-LaR2rRAsJN9Lsp8BQH4xFW" False) (((C1 (MetaCons "AB" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "BC" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "MB" PrefixI False) (U1 :: Type -> Type))) :+: (C1 (MetaCons "NB" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "NL" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "NS" PrefixI False) (U1 :: Type -> Type)))) :+: ((C1 (MetaCons "NT" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "NU" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "ON" PrefixI False) (U1 :: Type -> Type))) :+: ((C1 (MetaCons "PE" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "QC" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "SK" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "YT" PrefixI False) (U1 :: Type -> Type)))))

all :: [Code] Source #

A list of every Province/Territory Code.

toName :: Code -> Text Source #

Render a Code to it's English name.

fromName :: Text -> Maybe Code Source #

Parse a Code from an English name. This is case-insensitive.

isProvince :: Code -> Bool Source #

Does the Code denote a Province?

isTerritory :: Code -> Bool Source #

Does the Code denote a Territory?