, HS(..)
, mkDomainName
+ , mkDN
+ , isZoneOf
+
, wrapQuestion
, wrapRecord
)
import Data.IntMap (IntMap)
import qualified Data.IntSet as IS
import Data.IntSet (IntSet)
+import Data.List
import qualified Data.Map as M
import Data.Map (Map)
import Data.Word
unconsLabel (DN (x:xs)) = (x, DN xs)
unconsLabel x = error ("Illegal use of unconsLabel: " ++ show x)
+isZoneOf :: DomainName -> DomainName -> Bool
+isZoneOf (DN a) (DN b) = a `isSuffixOf` b
+
mkDomainName :: String -> DomainName
mkDomainName = DN . mkLabels [] . notEmpty
where
-> mkLabels (C8.pack l : soFar) rest
_ -> error ("Illegal domain name: " ++ xs)
+mkDN :: String -> DomainName
+mkDN = mkDomainName
+
class (Show rc, Eq rc, Typeable rc) => RecordClass rc where
rcToInt :: rc -> Int