Haskell utilities for manipulating logical statements