-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | The publicsuffix list exposed as proper Haskell types
--   
--   This package contains a parsed representation of the publicsuffix
--   list, and functions which you can use to query it.
--   
--   The package version follows the template <tt>&lt;api
--   version&gt;.&lt;date&gt;</tt> where <tt>date</tt> is when the
--   publicsuffix list was last updated from upstream, in the format
--   <tt>YYYYMMDD</tt>.
@package publicsuffix
@version 0.20180513


-- | This module contains the parsed rules from the upstream publicsuffix
--   list. The rules are autogenerated using Template-Haskell.
--   
--   You should not need this module directly, all interesting functions
--   are exposed in the <a>PublicSuffix</a> module. It is only exposed so
--   that we can run tests on the actual rules list instead of having to
--   mock the data. The list is not that long, so running exhaustive tests
--   on the full list is feasible.
module Data.PublicSuffix.Rules
data Rule
Rule :: !Bool -> ![String] -> Rule

-- | Whether this rule is an exception or not.
[isException] :: Rule -> !Bool

-- | The domain labels in reversed order, ie:
--   
--   <pre>
--   "test.example.com" =&gt; ["com", "example", "test"]
--   </pre>
[ruleLabels] :: Rule -> ![String]
rules :: [Rule]

module Data.PublicSuffix

-- | Return the public suffix of the given domain name (a dot-delimited
--   unicode string). The public suffix is the part of a domain which
--   should be protected.
--   
--   Notes:
--   
--   <ul>
--   <li>The domain MUST NOT start with a dot. Normalize the domain before
--   passing it to functions in this module.</li>
--   <li>The domain MUST NOT be in punycode encoding. The matching of
--   domain labels is done on the original encoding, as specified in the
--   upstream publicsuffix list.</li>
--   </ul>
--   
--   In particular that means applications SHOULD reject:
--   
--   <ul>
--   <li>HTTP cookies which try to set domain to a public suffix.</li>
--   <li>X509 wildcard certificates which try to match all subdomains of a
--   public suffix.</li>
--   </ul>
publicSuffix :: String -> String

-- | Return the domain that was registered or is registrable by a user.
--   These domains are fully controlled by users, and applications SHOULD
--   accept cookies and wildcard certificates for those.
registeredDomain :: String -> Maybe String
