cabal: use the same logic for the 'extension' function here as in haskell-defaults.nix