{-# LANGUAGE DoAndIfThenElse #-} -- | The 'Domain' data type and its parser. A 'Domain' represents a -- name in the domain name system (DNS) as described by -- RFC1035. In particular, we enforce the restrictions from Section -- 2.3.1 \"Preferred name syntax\". See for example, -- -- -- -- We basically work with strings and characters everywhere, even -- though this isn't really correct. The length specifications in -- the RFCs are all in terms of octets, so really a ByteString.Char8 -- would be more appropriate. With strings, for example, we could -- have a unicode mumbo jumbo character that takes up two bytes -- (octets). -- module Network.DNS.RBL.Domain ( Domain(..), domain ) where import Text.Parsec ( (<|>), char, optionMaybe, string, try ) import Text.Parsec.String ( Parser ) import Network.DNS.RBL.Domain.LdhStr ( LdhStr(..), ldh_str, ldh_str_length ) import Network.DNS.RBL.Domain.LetDig ( LetDig, let_dig ) import Network.DNS.RBL.Domain.LetDigHyp ( LetDigHyp(..) ) import Network.DNS.RBL.Pretty ( Pretty(..) ) import Network.DNS.RBL.Reversible ( Reversible(..) ) -- * Letter/Digit/Hyphen string followed by a trailing Letter/Digit -- | This type isn't explicitly part of the grammar, but it's what -- shows up in the square brackets of, -- --