tested on ghc 7.8.3