X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fharbl.git;a=blobdiff_plain;f=src%2FDomain.hs;h=46c93061f3247c7710c202a530f8e9cd8f95bf30;hp=8d1e0885c8ae57739a6a24c8e5ec697739e57c7c;hb=e8ff5a36c776c6808aacaa6ba488fe5fd19db497;hpb=15e7cd1fba0dc7ebbdd517154d64e4d7fe3750e1 diff --git a/src/Domain.hs b/src/Domain.hs index 8d1e088..46c9306 100644 --- a/src/Domain.hs +++ b/src/Domain.hs @@ -5,7 +5,16 @@ -- -- -- -module Domain +-- 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 Domain ( + UserDomain, + user_domain ) where import Data.Char ( toLower ) @@ -25,7 +34,7 @@ import Text.Parsec ( import qualified Text.Parsec as Parsec ( digit, letter) import Text.Parsec.String ( Parser ) -import Pretty +import Pretty ( Pretty(..) ) -- * Digits @@ -65,7 +74,11 @@ letter = fmap Letter Parsec.letter -- manner... -- -- Since each part of DNS name is composed of our custom types, it --- suffices to munge the equality for 'Letter'. +-- suffices to munge the equality for 'Letter'. RFC4343 +-- clarifies the +-- case-insensitivity rules, but the fact that we're treating DNS +-- names as strings makes most of those problems go away (in +-- exchange for new ones). -- instance Eq Letter where (Letter l1) == (Letter l2) = (toLower l1) == (toLower l2) @@ -375,6 +388,14 @@ length_ldh_str_let_dig (LdhStrLetDig (Just ldhstring) _) = -- --