Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Iri = Iri !Scheme !Hierarchy !Query !Fragment
- newtype Scheme = Scheme ByteString
- data Hierarchy
- data Authority = Authority !UserInfo !Host !Port
- data UserInfo
- newtype User = User Text
- data Password
- data Host
- newtype RegName = RegName (Vector DomainLabel)
- newtype DomainLabel = DomainLabel Text
- data Port
- newtype Path = Path (Vector PathSegment)
- newtype PathSegment = PathSegment Text
- newtype Query = Query Text
- newtype Fragment = Fragment Text
- data HttpIri = HttpIri !Security !Host !Port !Path !Query !Fragment
- newtype Security = Security Bool
- httpIriFromIri :: Iri -> Either Text HttpIri
- iriFromHttpIri :: HttpIri -> Iri
Documentation
Thorough structure of IRI.
Instances
Eq Iri Source # | |
Ord Iri Source # | |
Show Iri Source # | |
Generic Iri Source # | |
Lift Iri Source # | |
Hashable Iri Source # | |
Defined in Iri.Data.Instances.Hashable | |
type Rep Iri Source # | |
Defined in Iri.Data.Instances.Generic type Rep Iri = D1 (MetaData "Iri" "Iri.Data.Types" "iri-0.3.4.1-63VnVWeVbX43GtvuuPYdgp" False) (C1 (MetaCons "Iri" PrefixI False) ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Scheme) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Hierarchy)) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Query) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Fragment)))) |
Instances
Eq Scheme Source # | |
Ord Scheme Source # | |
Show Scheme Source # | |
Generic Scheme Source # | |
Lift Scheme Source # | |
Hashable Scheme Source # | |
Defined in Iri.Data.Instances.Hashable | |
type Rep Scheme Source # | |
Defined in Iri.Data.Instances.Generic type Rep Scheme = D1 (MetaData "Scheme" "Iri.Data.Types" "iri-0.3.4.1-63VnVWeVbX43GtvuuPYdgp" True) (C1 (MetaCons "Scheme" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString))) |
Instances
Eq Hierarchy Source # | |
Ord Hierarchy Source # | |
Defined in Iri.Data.Instances.Ord | |
Show Hierarchy Source # | |
Generic Hierarchy Source # | |
Lift Hierarchy Source # | |
Hashable Hierarchy Source # | |
Defined in Iri.Data.Instances.Hashable | |
type Rep Hierarchy Source # | |
Defined in Iri.Data.Instances.Generic type Rep Hierarchy = D1 (MetaData "Hierarchy" "Iri.Data.Types" "iri-0.3.4.1-63VnVWeVbX43GtvuuPYdgp" False) (C1 (MetaCons "AuthorisedHierarchy" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Authority) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Path)) :+: (C1 (MetaCons "AbsoluteHierarchy" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Path)) :+: C1 (MetaCons "RelativeHierarchy" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Path)))) |
Instances
Eq Authority Source # | |
Ord Authority Source # | |
Defined in Iri.Data.Instances.Ord | |
Show Authority Source # | |
Generic Authority Source # | |
Lift Authority Source # | |
Hashable Authority Source # | |
Defined in Iri.Data.Instances.Hashable | |
type Rep Authority Source # | |
Defined in Iri.Data.Instances.Generic type Rep Authority = D1 (MetaData "Authority" "Iri.Data.Types" "iri-0.3.4.1-63VnVWeVbX43GtvuuPYdgp" False) (C1 (MetaCons "Authority" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 UserInfo) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Host) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Port)))) |
Instances
Eq UserInfo Source # | |
Ord UserInfo Source # | |
Defined in Iri.Data.Instances.Ord | |
Show UserInfo Source # | |
Generic UserInfo Source # | |
Lift UserInfo Source # | |
Hashable UserInfo Source # | |
Defined in Iri.Data.Instances.Hashable | |
type Rep UserInfo Source # | |
Defined in Iri.Data.Instances.Generic type Rep UserInfo = D1 (MetaData "UserInfo" "Iri.Data.Types" "iri-0.3.4.1-63VnVWeVbX43GtvuuPYdgp" False) (C1 (MetaCons "PresentUserInfo" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 User) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Password)) :+: C1 (MetaCons "MissingUserInfo" PrefixI False) (U1 :: Type -> Type)) |
Instances
Eq Password Source # | |
Ord Password Source # | |
Defined in Iri.Data.Instances.Ord | |
Show Password Source # | |
Generic Password Source # | |
Lift Password Source # | |
Hashable Password Source # | |
Defined in Iri.Data.Instances.Hashable | |
type Rep Password Source # | |
Defined in Iri.Data.Instances.Generic type Rep Password = D1 (MetaData "Password" "Iri.Data.Types" "iri-0.3.4.1-63VnVWeVbX43GtvuuPYdgp" False) (C1 (MetaCons "PresentPassword" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)) :+: C1 (MetaCons "MissingPassword" PrefixI False) (U1 :: Type -> Type)) |
Instances
Eq Host Source # | |
Ord Host Source # | |
Show Host Source # | |
Generic Host Source # | |
Lift Host Source # | |
Hashable Host Source # | |
Defined in Iri.Data.Instances.Hashable | |
type Rep Host Source # | |
Defined in Iri.Data.Instances.Generic type Rep Host = D1 (MetaData "Host" "Iri.Data.Types" "iri-0.3.4.1-63VnVWeVbX43GtvuuPYdgp" False) (C1 (MetaCons "NamedHost" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 RegName)) :+: (C1 (MetaCons "IpV4Host" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 IPv4)) :+: C1 (MetaCons "IpV6Host" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 IPv6)))) |
Instances
Eq RegName Source # | |
Ord RegName Source # | |
Show RegName Source # | |
Generic RegName Source # | |
Lift RegName Source # | |
Hashable RegName Source # | |
Defined in Iri.Data.Instances.Hashable | |
type Rep RegName Source # | |
Defined in Iri.Data.Instances.Generic type Rep RegName = D1 (MetaData "RegName" "Iri.Data.Types" "iri-0.3.4.1-63VnVWeVbX43GtvuuPYdgp" True) (C1 (MetaCons "RegName" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Vector DomainLabel)))) |
newtype DomainLabel Source #
Instances
Instances
Eq Port Source # | |
Ord Port Source # | |
Show Port Source # | |
Generic Port Source # | |
Lift Port Source # | |
Hashable Port Source # | |
Defined in Iri.Data.Instances.Hashable | |
type Rep Port Source # | |
Defined in Iri.Data.Instances.Generic type Rep Port = D1 (MetaData "Port" "Iri.Data.Types" "iri-0.3.4.1-63VnVWeVbX43GtvuuPYdgp" False) (C1 (MetaCons "PresentPort" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Word16)) :+: C1 (MetaCons "MissingPort" PrefixI False) (U1 :: Type -> Type)) |
Instances
Eq Path Source # | |
Ord Path Source # | |
Show Path Source # | |
Generic Path Source # | |
Lift Path Source # | |
Hashable Path Source # | |
Defined in Iri.Data.Instances.Hashable | |
type Rep Path Source # | |
Defined in Iri.Data.Instances.Generic type Rep Path = D1 (MetaData "Path" "Iri.Data.Types" "iri-0.3.4.1-63VnVWeVbX43GtvuuPYdgp" True) (C1 (MetaCons "Path" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Vector PathSegment)))) |
newtype PathSegment Source #
Instances
Since the exact structure of the query string is not standardised and methods used to parse the query string may differ between websites, we simply represent it as a decoded Unicode string.
Special cases
HTTP special case
HTTP being by far the most common use-case for resource identifiers, it's been isolated into a dedicated data-type, which is optimised for that particular case.
Compared to the general IRI definition it:
- only supports the HTTP and HTTPS schemes
- misses the Username and Password components
- requires the Host component
- requires the Path component to be absolute
Instances
iriFromHttpIri :: HttpIri -> Iri Source #
Generalize an HTTP IRI to IRI