]> gitweb.michael.orlitzky.com - hath.git/blobdiff - src/Maskbits.hs
Add more Haddock comments.
[hath.git] / src / Maskbits.hs
index d7064d89ad81ee615fa9c0c470636b423db2687e..ac46ccf96a316a3233e961d9e00d637c95c3d11b 100644 (file)
@@ -6,7 +6,7 @@ module Maskbits
 
 import Test.QuickCheck
 
--- A type representing the number of bits in a CIDR netmask.
+-- A type representing the number of bits in a CIDR netmask.
 data Maskbits =
     Zero
   | One
@@ -156,6 +156,8 @@ maskbits_from_int 31 = Just ThirtyOne
 maskbits_from_int 32 = Just ThirtyTwo
 maskbits_from_int _  = Nothing
 
+
+-- | Convert a String to Maskbits, if possible.
 maskbits_from_string :: String -> Maybe Maskbits
 maskbits_from_string s =
   case (reads s :: [(Int, String)]) of
@@ -164,6 +166,7 @@ maskbits_from_string s =
 
 
 
+-- | Maskbits are just natural numbers, this returns the previous one.
 decrement :: Maskbits -> Maskbits
 decrement Zero = Zero
 decrement One = Zero