Factored out hs-complex-utils library.