forked from bortzmeyer/GaBuZoMeu
22 lines
658 B
Haskell
22 lines
658 B
Haskell
|
-- Haskell types to support the language tags
|
||
|
|
||
|
module Types where
|
||
|
|
||
|
type Language = String
|
||
|
type Extlang = Maybe String -- Only one extlang authorized
|
||
|
type Script = Maybe String
|
||
|
type Region = Maybe String
|
||
|
type Singleton = Char
|
||
|
type Variants = [Variant]
|
||
|
type Variant = String
|
||
|
type Extension = (Singleton, [String])
|
||
|
type Extensions = [Extension]
|
||
|
|
||
|
type Grandfathered = String
|
||
|
type Privateuse = [String]
|
||
|
|
||
|
data Tag = Tag Language Extlang Script Region Variants Extensions | GF Grandfathered | Priv Privateuse deriving (Show, Eq)
|
||
|
-- TODO: warning, Eq must
|
||
|
-- be redefined because it needs to take into account case-insensitivity and
|
||
|
-- (maybe) canonicalization
|