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


-- | Is a given string a domain suffix?
--   
--   Is a given string a domain suffix?
@package publicsuffixlist
@version 0.1


-- | This script parses the public suffix list, and constructs a data
--   structure which can be used with the isSuffix function in Lookup.hs.
--   It exports a GSink which produces the opaque <a>DataStructure</a> and
--   can be fed any Source as input.
--   
--   This makes an few assumption about the information in the public
--   suffix list: namely, that no rule is a suffix of another rule. For
--   example, if there is a rule abc.def.ghi then then is no other rule
--   def.ghi or !def.ghi
--   
--   The actual data structure involved here is a tree where the nodes have
--   no value and the edges are DNS labels. There are two trees: one to
--   handle the exception rules, and one to handle the regular rules.
module Network.PublicSuffixList.Create
data PublicSuffixListException
sink :: MonadThrow m => Sink ByteString m DataStructure
instance GHC.Show.Show Network.PublicSuffixList.Create.PublicSuffixListException
instance GHC.Exception.Type.Exception Network.PublicSuffixList.Create.PublicSuffixListException

module Network.PublicSuffixList.DataStructure

-- | The opaque data structure that <tt>isSuffix</tt> can query. This data
--   structure was generated at 2013-04-11 07:27:06.592735 UTC
dataStructure :: DataStructure

module Network.PublicSuffixList.Lookup

-- | <pre>
--   &gt;&gt;&gt; effectiveTLDPlusOne = effectiveTLDPlusOne' Network.PublicSuffixList.DataStructure.dataStructure
--   </pre>
effectiveTLDPlusOne :: Text -> Maybe Text

-- | This function returns whether or not this domain is owned by a
--   registrar or a regular person. <a>Nothing</a> means that this is a
--   registrar domain; 'Just x' means it's owned by a person. This is used
--   to determine if a cookie is allowed to bet set for a particular
--   domain. For example, you shouldn't be able to set a cookie for "com".
--   
--   If the value is 'Just x', then the x value is what is known as the
--   effective TLD plus one. This is one segment more than the suffix of
--   the domain. For example, the eTLD+1 for "this.is.a.subdom.com" is Just
--   "subdom.com"
--   
--   Note that this function expects lowercase ASCII strings. These strings
--   should be gotten from the toASCII algorithm as described in RFC 3490.
--   These strings should not start or end with the '.' character, and
--   should not have two '.' characters next to each other. (The toASCII
--   algorithm is implemented in the 'idna' hackage package, though that
--   package doesn't always map strings to lowercase)
effectiveTLDPlusOne' :: DataStructure -> Text -> Maybe Text

-- | <pre>
--   &gt;&gt;&gt; isSuffix = isSuffix' Network.PublicSuffixList.DataStructure.dataStructure
--   </pre>
isSuffix :: Text -> Bool

-- | <pre>
--   &gt;&gt;&gt; isSuffix' dataStructure = isNothing . effectiveTLDPlusOne' dataStructure
--   </pre>
isSuffix' :: DataStructure -> Text -> Bool
instance GHC.Classes.Eq Network.PublicSuffixList.Lookup.LookupResult
