{-# OPTIONS_GHC -funbox-strict-fields #-}
module Iri.Data.Types where
import Iri.Prelude
data Iri = Iri !Scheme !Hierarchy !Query !Fragment
newtype Scheme = Scheme ByteString
data Hierarchy
= AuthorisedHierarchy !Authority !Path
| AbsoluteHierarchy !Path
| RelativeHierarchy !Path
data Authority = Authority !UserInfo !Host !Port
data UserInfo
= PresentUserInfo !User !Password
| MissingUserInfo
newtype User = User ByteString
data Password
= PresentPassword !ByteString
| MissingPassword
data Host
= NamedHost !RegName
| IpV4Host !IPv4
| IpV6Host !IPv6
newtype RegName = RegName (Vector DomainLabel)
data DomainLabel = DomainLabel Text
data Port
= PresentPort !Word16
| MissingPort
newtype Path = Path (Vector PathSegment)
newtype PathSegment = PathSegment ByteString
newtype Query = Query ByteString
newtype Fragment = Fragment ByteString
data HttpIri = HttpIri !Security !Host !Port !Path !Query !Fragment
newtype Security = Security Bool