Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't import Prelude in the generated Build_doctests modules. #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# next

* Don't import `Prelude` in the generated `Build_doctests` modules.

`Prelude` is a magical module name, and it may be useful for users
to define their own `Prelude` modules which may not coincide with
the `Prelude` from `base`.

# 1.0.6 -- 2018-01-28

* Hook `haddock` build too. Fixes issue when `haddock` fails, as
Expand Down
8 changes: 6 additions & 2 deletions src/Distribution/Extra/Doctest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,13 @@ generateBuildModule testSuiteName flags pkg lbi = do
-- First, we create the autogen'd module Build_doctests.
-- Initially populate Build_doctests with a simple preamble.
writeFile buildDoctestsFile $ unlines
[ "module Build_doctests where"
[ "{-# LANGUAGE NoImplicitPrelude #-}"
, "module Build_doctests where"
, ""
, "import Prelude"
, "import Data.Eq (Eq)"
, "import Data.Maybe (Maybe (Nothing))"
, "import Data.String (String)"
, "import Text.Show (Show)"
, ""
, "data Name = NameLib (Maybe String) | NameExe String deriving (Eq, Show)"
, "data Component = Component Name [String] [String] [String] deriving (Eq, Show)"
Expand Down