-- | Create an address pool from a network.
createAddressPool :: Network -> Maybe AddressPool
createAddressPool n
  | networkIsValid n =
      let res = maybeStr2BitVec $ networkReservations n
          ext_res = maybeStr2BitVec $ networkExtReservations n
      in  Just AddressPool { reservations = res
                           , extReservations = ext_res
                           , network = n }
  | otherwise = Nothing
createAddressPool :: Network -> Maybe AddressPool
createAddressPool n
  | networkIsValid n =
      let res = maybeStr2BitVec $ networkReservations n
          ext_res = maybeStr2BitVec $ networkExtReservations n
      in  Just AddressPool { reservations = res
                           , extReservations = ext_res
                           , network = n }
  | otherwise = Nothing
createAddressPool n
  | networkIsValid n =
      let res = maybeStr2BitVec $ networkReservations n
          ext_res = maybeStr2BitVec $ networkExtReservations n
      in  Just AddressPool { reservations = res
                           , extReservations = ext_res
                           , network = n }
  | otherwise = Nothing