michael orlitzky


Get It

Browse source
Clone it
git clone https://gitweb.michael.orlitzky.com/hath.git

What is it?

Hath is a Haskell program for working with network blocks in CIDR notation. When dealing with blocks of network addresses, there are a few things that one usually wants to do with them:

Hath does just that. It takes as its input (via stdin) a list of CIDR blocks.


Hath has the following modes:


This computes a (Perl-compatible) regular expression matching the input CIDR blocks. It's the default mode of operation.

user $ echo "" | hath



This combines small blocks into larger ones where possible, and eliminates redundant blocks. The output should be equivalent to the input, though.

user $ echo "" | hath reduced


Shows only the blocks that would be removed by reduce; that is, it shows the ones that would get combined into larger blocks or are simply redundant.

user $ echo "" | hath duped


Shows what would change if you used reduce. Uses diff-like notation.

user $ echo "" | hath diffed





List the IP addresses contained within the given CIDRs.

user $ echo | hath listed

The command-line syntax and complete set of options are documented in the man page.


All of the software dependencies are listed in the hath.cabal file. Just use cabal to build it.


Cabal handles the build, so do whatever you normally do to install cabal packages. If you just want to install it for your user,

user $ runghc Setup.hs configure --user

user $ runghc Setup.hs build

user $ runghc Setup.hs install

should do it.

How to report bugs

Email them to me at michael@orlitzky.com.