@@ -221,6 +221,7 @@ in package-set { inherit pkgs stdenv callPackage; } self // {
221221 # , overrides : Defaulted (HaskellPackageOverrideSet)
222222 # , modifier : Defaulted
223223 # , returnShellEnv : Defaulted
224+ # , withHoogle : Defaulted
224225 # } -> NixShellAwareDerivation
225226 # Given a path to a haskell package directory, an optional package name
226227 # which defaults to the base name of the path, an optional set of source
@@ -231,20 +232,26 @@ in package-set { inherit pkgs stdenv callPackage; } self // {
231232 # If 'returnShellEnv' is true this returns a derivation which will give you
232233 # an environment suitable for developing the listed packages with an
233234 # incremental tool like cabal-install.
235+ # If 'withHoogle' is true (the default if a shell environment is requested)
236+ # then 'ghcWithHoogle' is used to generate the derivation (instead of
237+ # 'ghcWithPackages'), see the documentation there for more information.
234238 developPackage =
235239 { root
236240 , name ? builtins.baseNameOf root
237241 , source-overrides ? {}
238242 , overrides ? self: super: {}
239243 , modifier ? drv: drv
240− , returnShellEnv ? pkgs.lib.inNixShell }:
244+ , returnShellEnv ? pkgs.lib.inNixShell
245+ , withHoogle ? returnShellEnv }:
241246 let drv =
242247 (extensible-self.extend
243248 (pkgs.lib.composeExtensions
244249 (self.packageSourceOverrides source-overrides)
245250 overrides))
246251 .callCabal2nix name root {};
247− in if returnShellEnv then (modifier drv).env else modifier drv;
252+ in if returnShellEnv
253+ then (modifier drv).envFunc {inherit withHoogle;}
254+ else modifier drv;
248255
249256 ghcWithPackages = selectFrom: withPackages (selectFrom self);
250257