GaBuZoMeu/Types.hs
Stephane Bortzmeyer 2fc541c0a7 Initial import
2023-06-08 21:49:35 +02:00

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