diff --git a/.ghci b/.ghci
deleted file mode 100644
--- a/.ghci
+++ /dev/null
@@ -1,1 +0,0 @@
-:set -isrc -idist/build/autogen -optP-include -optPdist/build/autogen/cabal_macros.h
diff --git a/.travis.yml b/.travis.yml
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,17 +1,118 @@
-language: haskell
-before_install:
-  # Uncomment whenever hackage is down.
-  # - mkdir -p ~/.cabal && cp config ~/.cabal/config && cabal update
+# This file has been generated -- see https://github.com/hvr/multi-ghc-travis
+language: c
+sudo: false
 
-  # Try installing some of the build-deps with apt-get for speed.
-  - ./travis-cabal-apt-install --only-dependencies --force-reinstall $mode
+cache:
+  directories:
+    - $HOME/.cabsnap
+    - $HOME/.cabal/packages
+    - $HOME/.stack
 
+before_cache:
+  - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
+  - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
+
+matrix:
+  include:
+    - env: CABALVER=1.16 GHCVER=7.4.2 BUILD=cabal
+      compiler: ": #GHC 7.4.2"
+      addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2,alex-3.1.4,happy-1.19.5], sources: [hvr-ghc]}}
+
+    - env: CABALVER=1.16 GHCVER=7.6.3 BUILD=cabal
+      compiler: ": #GHC 7.6.3"
+      addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3,alex-3.1.4,happy-1.19.5], sources: [hvr-ghc]}}
+
+    - env: CABALVER=1.18 GHCVER=7.8.4 BUILD=cabal
+      compiler: ": #GHC 7.8.4"
+      addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,alex-3.1.4,happy-1.19.5], sources: [hvr-ghc]}}
+
+    - env: BUILD=stack STACK_YAML=stack-7.8.yaml STACK_OPTIONS=--skip-ghc-check
+      addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,alex-3.1.4,happy-1.19.5], sources: [hvr-ghc]}}
+
+    - env: BUILD=stack STACK_YAML=stack-7.8.yaml
+      os: osx
+
+    - env: CABALVER=1.22 GHCVER=7.10.1 BUILD=cabal
+      compiler: ": #GHC 7.10.1"
+      addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1,alex-3.1.4,happy-1.19.5], sources: [hvr-ghc]}}
+
+    - env: CABALVER=1.22 GHCVER=7.10.2 BUILD=cabal
+      compiler: ": #GHC 7.10.2"
+      addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2,alex-3.1.4,happy-1.19.5], sources: [hvr-ghc]}}
+
+    - env: BUILD=stack STACK_OPTIONS=--skip-ghc-check
+      addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2,alex-3.1.4,happy-1.19.5], sources: [hvr-ghc]}}
+
+    - env: BUILD=stack
+      os: osx
+
+
+before_install:
+ - unset CC
+ - case "$BUILD" in
+     stack)
+       export STACK_VERSION=0.1.3.0;
+       export PATH=~/bin:$PATH;
+       mkdir -p ~/bin;
+       travis_retry curl -L https://github.com/commercialhaskell/stack/releases/download/v$STACK_VERSION/stack-$STACK_VERSION-x86_64-$TRAVIS_OS_NAME.gz | gunzip > ~/bin/stack;
+       chmod a+x ~/bin/stack;
+       scripts/travis_long stack --no-terminal setup;;
+     cabal)
+       export HAPPYVER=1.19.5
+       export ALEXVER=3.1.4
+       export PATH=~/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:/opt/happy/$HAPPYVER/bin:/opt/alex/$ALEXVER/bin:$PATH;;
+   esac
 install:
-  - cabal configure -flib-Werror $mode
-  - cabal build
+ - case "$BUILD" in
+     stack)
+       scripts/travis_long stack --no-terminal $STACK_OPTIONS build --only-snapshot -j2;;
+     cabal)
+       echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
+       cabal --version;
+       if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];
+       then
+         zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >
+              $HOME/.cabal/packages/hackage.haskell.org/00-index.tar;
+       fi;
+       travis_retry cabal update;
+       cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt;
+       sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt;
+       if diff -u installplan.txt $HOME/.cabsnap/installplan.txt; then
+         echo "cabal build-cache HIT";
+         rm -rfv .ghc;
+         cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
+         cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
+       else
+         echo "cabal build-cache MISS";
+         rm -rf $HOME/.cabsnap;
+         mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
+         cabal install --only-dependencies --enable-tests --enable-benchmarks;
+         if [ "$GHCVER" = "7.10.1" ]; then cabal install Cabal-1.22.4.0; fi;
+       fi;
+       if [ ! -d $HOME/.cabsnap ]; then
+         echo "snapshotting package-db to build-cache";
+         mkdir $HOME/.cabsnap;
+         cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
+         cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;
+       fi;;
+   esac
 
+# snapshot package-db on cache miss
+
+# Here starts the actual work to be performed for the package under test;
+# any command which exits with a non-zero exit code causes the build to fail.
 script:
-  - $script
+ - case "$BUILD" in
+     stack)
+       scripts/travis_long stack --no-terminal $STACK_OPTIONS build -j2;;
+     cabal)
+       cabal configure --enable-tests -v2;
+       cabal build;
+       cabal test;
+       cabal bench || true;
+       cabal sdist || true;
+       SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && (cd dist && cabal install --force-reinstalls "$SRC_TGZ");;
+   esac
 
 notifications:
   irc:
@@ -19,7 +120,5 @@
       - "irc.freenode.org#haskell-lens"
     skip_join: true
     template:
-      - "\x0313distributive\x03/\x0306%{branch}\x03 \x0314%{commit}\x03 %{build_url} %{message}"
-
-env:
-  - mode="--enable-tests" script="cabal test"
+      - "\x0313distributive\x0f/\x0306%{branch}\x0f \x0314%{commit}\x0f %{message} \x0302\x1f%{build_url}\x0f"
+# EOF
diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown
--- a/CHANGELOG.markdown
+++ b/CHANGELOG.markdown
@@ -1,3 +1,9 @@
+0.5
+---
+* Added flags for removing some dependencies.
+* Support `doctests` when building to non-standard locations (such as when using `stack`.)
+* Support `base-orphans`
+
 0.4.4
 -----
 * `transformers 0.4` compatibility
diff --git a/LICENSE b/LICENSE
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright 2011-2014 Edward Kmett
+Copyright 2011-2016 Edward Kmett
 
 All rights reserved.
 
diff --git a/README.markdown b/README.markdown
--- a/README.markdown
+++ b/README.markdown
@@ -1,7 +1,7 @@
 distributive
 ============
 
-[![Build Status](https://secure.travis-ci.org/ekmett/distributive.png?branch=master)](http://travis-ci.org/ekmett/distributive)
+[![Hackage](https://img.shields.io/hackage/v/distributive.svg)](https://hackage.haskell.org/package/distributive) [![Build Status](https://secure.travis-ci.org/ekmett/distributive.png?branch=master)](http://travis-ci.org/ekmett/distributive)
 
 This package provides the notion that is categorically dual to `Traversable`.
 
diff --git a/Setup.lhs b/Setup.lhs
--- a/Setup.lhs
+++ b/Setup.lhs
@@ -30,6 +30,10 @@
     withTestLBI pkg lbi $ \suite suitecfg -> do
       rewriteFile (dir </> "Build_" ++ testName suite ++ ".hs") $ unlines
         [ "module Build_" ++ testName suite ++ " where"
+        , ""
+        , "autogen_dir :: String"
+        , "autogen_dir = " ++ show dir
+        , ""
         , "deps :: [String]"
         , "deps = " ++ (show $ formatdeps (testDeps libcfg suitecfg))
         ]
diff --git a/distributive.cabal b/distributive.cabal
--- a/distributive.cabal
+++ b/distributive.cabal
@@ -1,6 +1,6 @@
 name:          distributive
 category:      Data Structures
-version:       0.4.4
+version:       0.5
 license:       BSD3
 cabal-version: >= 1.8
 license-file:  LICENSE
@@ -9,12 +9,11 @@
 stability:     provisional
 homepage:      http://github.com/ekmett/distributive/
 bug-reports:   http://github.com/ekmett/distributive/issues
-copyright:     Copyright (C) 2011-2014 Edward A. Kmett
+copyright:     Copyright (C) 2011-2016 Edward A. Kmett
 synopsis:      Distributive functors -- Dual to Traversable
 description:   Distributive functors -- Dual to Traversable
 build-type:    Custom
 extra-source-files:
-  .ghci
   .travis.yml
   .vim.custom
   config
@@ -26,15 +25,19 @@
   type: git
   location: git://github.com/ekmett/distributive.git
 
-flag lib-Werror
+flag tagged
   manual: True
-  default: False
+  default: True
+  description:
+    You can disable the use of the `tagged` package using `-f-tagged`.
+    .
+    Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users.
 
 library
   build-depends:
     base                >= 4   && < 5,
-    tagged              >= 0.7 && < 1,
-    transformers        >= 0.2 && < 0.5,
+    base-orphans        >= 0.5 && < 1,
+    transformers        >= 0.2 && < 0.6,
     transformers-compat >= 0.3 && < 1
 
   hs-source-dirs:  src
@@ -43,12 +46,14 @@
 
   if impl(ghc>=7.2)
     exposed-modules: Data.Distributive.Generic
+
+  if flag(tagged)
+    build-depends: tagged >= 0.7 && < 1
+
+  if impl(ghc>=7.4 && < 7.6)
     build-depends: ghc-prim
 
-  if flag(lib-Werror)
-    ghc-options: -Werror
-  else
-    ghc-options: -Wall
+  ghc-options: -Wall
 
 -- Verify the results of the examples
 test-suite doctests
@@ -60,6 +65,4 @@
     doctest   >= 0.9.1,
     filepath  >= 1.2
   ghc-options: -Wall -threaded
-  if impl(ghc<7.6.1)
-    ghc-options: -Werror
   hs-source-dirs: tests
diff --git a/src/Data/Distributive.hs b/src/Data/Distributive.hs
--- a/src/Data/Distributive.hs
+++ b/src/Data/Distributive.hs
@@ -3,7 +3,7 @@
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Data.Distributive
--- Copyright   :  (C) 2011-2014 Edward Kmett
+-- Copyright   :  (C) 2011-2016 Edward Kmett
 -- License     :  BSD-style (see the file LICENSE)
 --
 -- Maintainer  :  Edward Kmett <ekmett@gmail.com>
@@ -29,8 +29,18 @@
 import Data.Functor.Identity
 import Data.Functor.Product
 import Data.Functor.Reverse
+import qualified Data.Monoid as Monoid
+import Data.Orphans ()
+
+#if MIN_VERSION_base(4,4,0)
+import Data.Complex
+#endif
+#if (defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 707) || defined(MIN_VERSION_tagged)
 import Data.Proxy
+#endif
+#ifdef MIN_VERSION_tagged
 import Data.Tagged
+#endif
 
 #ifdef HLINT
 {-# ANN module "hlint: ignore Use section" #-}
@@ -125,3 +135,24 @@
 
 instance Distributive f => Distributive (Reverse f) where
   distribute = Reverse . collect getReverse
+
+instance Distributive Monoid.Dual where
+  collect f  = Monoid.Dual . fmap (Monoid.getDual . f)
+  distribute = Monoid.Dual . fmap Monoid.getDual
+
+instance Distributive Monoid.Product where
+  collect f  = Monoid.Product . fmap (Monoid.getProduct . f)
+  distribute = Monoid.Product . fmap Monoid.getProduct
+
+instance Distributive Monoid.Sum where
+  collect f  = Monoid.Sum . fmap (Monoid.getSum . f)
+  distribute = Monoid.Sum . fmap Monoid.getSum
+
+#if MIN_VERSION_base(4,4,0)
+instance Distributive Complex where
+  distribute wc = fmap realP wc :+ fmap imagP wc where
+    -- Redefine realPart and imagPart to avoid incurring redundant RealFloat
+    -- constraints on older versions of base
+    realP (r :+ _) = r
+    imagP (_ :+ i) = i
+#endif
diff --git a/src/Data/Distributive/Generic.hs b/src/Data/Distributive/Generic.hs
--- a/src/Data/Distributive/Generic.hs
+++ b/src/Data/Distributive/Generic.hs
@@ -4,7 +4,7 @@
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Data.Distributive
--- Copyright   :  (C) 2011-2014 Edward Kmett
+-- Copyright   :  (C) 2011-2016 Edward Kmett
 -- License     :  BSD-style (see the file LICENSE)
 --
 -- Maintainer  :  Edward Kmett <ekmett@gmail.com>
diff --git a/tests/doctests.hs b/tests/doctests.hs
--- a/tests/doctests.hs
+++ b/tests/doctests.hs
@@ -1,7 +1,10 @@
+{-# LANGUAGE CPP #-}
 module Main where
 
-import Build_doctests (deps)
+import Build_doctests (autogen_dir, deps)
+#if __GLASGOW_HASKELL__ < 710
 import Control.Applicative
+#endif
 import Control.Monad
 import Data.List
 import System.Directory
@@ -11,9 +14,9 @@
 main :: IO ()
 main = getSources >>= \sources -> doctest $
     "-isrc"
-  : "-idist/build/autogen"
+  : ("-i" ++ autogen_dir)
   : "-optP-include"
-  : "-optPdist/build/autogen/cabal_macros.h"
+  : ("-optP" ++ autogen_dir ++ "/cabal_macros.h")
   : "-hide-all-packages"
   : map ("-package="++) deps ++ sources
 
