X-Git-Url: https://gitweb.michael.orlitzky.com/?p=hath.git;a=blobdiff_plain;f=src%2FMaskable.hs;h=9e72b8e211d04690242b93cd794195459fd4d4ba;hp=1441c07a6757b8ae3d80f781c52d8fb6fb5ea01d;hb=1e69264c4a60fef95d0ad013f95b082b3db106ab;hpb=d34688b75f995d99e112064225735921a8d4ee28 diff --git a/src/Maskable.hs b/src/Maskable.hs index 1441c07..9e72b8e 100644 --- a/src/Maskable.hs +++ b/src/Maskable.hs @@ -1,5 +1,6 @@ module Maskable where +import Bit import Maskbits -- Any string of bits should be maskable by some number of netmask @@ -12,6 +13,9 @@ import Maskbits -- should return 127.0.0.0, since 127.0.0.1/31 matches both 127.0.0.0 -- and 127.0.0.1. In this case, the final '0' or '1' is the host -- part of the address. The '127.0.0' is thus the network part. +-- +-- The Bit argument allows us to specify whether the host bits +-- should be replaced with either Zero or One. class Maskable a where - apply_mask :: a -> Maskbits -> a + apply_mask :: a -> Maskbits -> Bit -> a