···867867nix-build -A haskell.packages.integer-simple.ghc802.scientific
868868```
869869870870+### Quality assurance
871871+872872+The `haskell.lib` library includes a number of functions for checking for
873873+various imperfections in Haskell packages. It's useful to apply these functions
874874+to your own Haskell packages and integrate that in a Continuous Integration
875875+server like [hydra](https://nixos.org/hydra/) to assure your packages maintain a
876876+minimum level of quality. This section discusses some of these functions.
877877+878878+#### buildStrictly
879879+880880+Applying `haskell.lib.buildStrictly` to a Haskell package enables the `-Wall`
881881+and `-Werror` GHC options to turn all warnings into build failures. Additionally
882882+the source of your package is gotten from first invoking `cabal sdist` to ensure
883883+all needed files are listed in the Cabal file.
884884+885885+#### checkUnusedPackages
886886+887887+Applying `haskell.lib.checkUnusedPackages` to a Haskell package invokes
888888+the [packunused](http://hackage.haskell.org/package/packunused) tool on the
889889+package. `packunused` complains when it finds packages listed as build-depends
890890+in the Cabal file which are redundant. For example:
891891+892892+```
893893+$ nix-build -E 'let pkgs = import <nixpkgs> {}; in pkgs.haskell.lib.checkUnusedPackages {} pkgs.haskellPackages.scientific'
894894+these derivations will be built:
895895+ /nix/store/3lc51cxj2j57y3zfpq5i69qbzjpvyci1-scientific-0.3.5.1.drv
896896+...
897897+detected package components
898898+~~~~~~~~~~~~~~~~~~~~~~~~~~~
899899+900900+ - library
901901+ - testsuite(s): test-scientific
902902+ - benchmark(s): bench-scientific*
903903+904904+(component names suffixed with '*' are not configured to be built)
905905+906906+library
907907+~~~~~~~
908908+909909+The following package dependencies seem redundant:
910910+911911+ - ghc-prim-0.5.0.0
912912+913913+testsuite(test-scientific)
914914+~~~~~~~~~~~~~~~~~~~~~~~~~~
915915+916916+no redundant packages dependencies found
917917+918918+builder for ‘/nix/store/3lc51cxj2j57y3zfpq5i69qbzjpvyci1-scientific-0.3.5.1.drv’ failed with exit code 1
919919+error: build of ‘/nix/store/3lc51cxj2j57y3zfpq5i69qbzjpvyci1-scientific-0.3.5.1.drv’ failed
920920+```
921921+922922+As you can see, `packunused` finds out that although the testsuite component has
923923+no redundant dependencies the library component of `scientific-0.3.5.1` depends
924924+on `ghc-prim` which is unused in the library.
925925+870926## Other resources
871927872928 - The Youtube video [Nix Loves Haskell](https://www.youtube.com/watch?v=BsBhi_r-OeE)