Cabal builds the library files twice if the main executable and the library share the same hs-source-dirs. Moving the main executable source code to a subdirectory avoids this issue.