]> gitweb.michael.orlitzky.com - hath.git/blobdiff - src/IPv4Address.hs
Add an Ord instance for Cidr and use it to implement Eq.
[hath.git] / src / IPv4Address.hs
index fca1d0fe006cc33c659f4e883bfda3897f83f4d2..80a499ec88f66e1907471ea7e0fb2af10ac9d5c3 100644 (file)
@@ -9,22 +9,28 @@ where
 import Test.Tasty ( TestTree, testGroup )
 import Test.Tasty.HUnit ( (@?=), testCase )
 import Test.Tasty.QuickCheck (
-  Arbitrary(..),
+  Arbitrary( arbitrary ),
   Gen,
   Property,
   (==>),
   testProperty )
 
-import Maskable (Maskable(..))
-import Maskbits (Maskbits(..))
-import Octet (Octet(..))
+import Maskable ( Maskable( apply_mask) )
+import Maskbits (
+  Maskbits(
+    Zero, One, Two, Three, Four, Five, Six, Seven, Eight,
+    Nine, Ten, Eleven, Twelve, Thirteen, Fourteen, Fifteen, Sixteen,
+    Seventeen, Eighteen, Nineteen, Twenty, TwentyOne, TwentyTwo, TwentyThree,
+    TwentyFour, TwentyFive, TwentySix, TwentySeven, TwentyEight, TwentyNine,
+    Thirty, ThirtyOne, ThirtyTwo ) )
+import Octet ( Octet( b1, b2, b3, b4, b5, b6, b7, b8) )
 
 data IPv4Address =
   IPv4Address { octet1 :: Octet,
                 octet2 :: Octet,
                 octet3 :: Octet,
                 octet4 :: Octet }
-    deriving (Eq)
+    deriving (Eq, Ord)
 
 
 instance Show IPv4Address where