]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Data/URI/Internal/Scheme.hs
doc comments
[Lucu.git] / Data / URI / Internal / Scheme.hs
index 8bb5a7dd90522eb30061817586662be4b176a820..ebef877e376c4334a21d361ebe6bb5d92b103542 100644 (file)
@@ -28,7 +28,8 @@ import Prelude.Unicode
 
 -- |'Scheme' names consist of a non-empty sequence of characters
 -- beginning with a letter and followed by any combination of letters,
--- digits, plus (\'+\'), period (\'.\'), or hyphen (\'-\'):
+-- digits, plus (\'+\'), period (\'.\'), or hyphen (\'-\'). Comparison
+-- of 'Scheme's are always case-insensitive. See:
 -- <http://tools.ietf.org/html/rfc3986#section-3.1>
 newtype Scheme = Scheme CIAscii
     deriving ( Eq
@@ -39,7 +40,7 @@ newtype Scheme = Scheme CIAscii
              , Typeable
              )
 
--- |'isString' is a fast but unsafe way to create 'Scheme' such that
+-- |'fromString' is a fast but unsafe way to create 'Scheme' such that
 -- no validation on the string is performed.
 deriving instance IsString Scheme
 
@@ -63,14 +64,17 @@ instance Default (Parser Scheme) where
           {-# INLINE fromBS #-}
           fromBS = Scheme ∘ A.toCIAscii ∘ A.unsafeFromByteString
 
+-- |Extract a 'CIAscii' with all letters lowercased.
 instance ConvertSuccess Scheme CIAscii where
     {-# INLINE convertSuccess #-}
     convertSuccess (Scheme s) = foldCase s
 
+-- |Create an 'AsciiBuilder' with all letters lowercased.
 instance ConvertSuccess Scheme AsciiBuilder where
     {-# INLINE convertSuccess #-}
     convertSuccess = A.toAsciiBuilder ∘ A.fromCIAscii ∘ cs
 
+-- |Try to parse a 'Scheme' from 'CIAscii'.
 instance ConvertAttempt CIAscii Scheme where
     {-# INLINE convertAttempt #-}
     convertAttempt = parseAttempt' def ∘ A.fromCIAscii