From b42525e21ffbbb0a5da77d593cc84e119f4fa007 Mon Sep 17 00:00:00 2001 From: Ignat Insarov Date: Tue, 23 Jan 2018 20:42:55 +0700 Subject: [PATCH 1/2] Enhance README with explanation concerning issue #167. --- README.markdown | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.markdown b/README.markdown index 7dc26a01..7169cd19 100644 --- a/README.markdown +++ b/README.markdown @@ -114,6 +114,9 @@ Here is an example: ```haskell module Foo where + +import Bar.Baz + -- $setup -- >>> let x = 23 :: Int @@ -124,6 +127,12 @@ foo :: Int foo = 42 ``` +Note that you should not place setup code inbetween the module header (`module +... where`) and import declarations. GHC will not be able to parse it (issue + #167). It is best to place setup code right after import declarations, but due +to its declarative nature you can place it anywhere inbetween top level +declarations as well. + ### Multi-line input GHCi supports commands which span multiple lines, and the same syntax works for doctest: From a97b756564cbc295adcec1d413a42c518fdb5dff Mon Sep 17 00:00:00 2001 From: Ignat Insarov Date: Tue, 23 Jan 2018 20:50:37 +0700 Subject: [PATCH 2/2] README: fix markdown. --- README.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.markdown b/README.markdown index 7169cd19..1914fa27 100644 --- a/README.markdown +++ b/README.markdown @@ -128,10 +128,10 @@ foo = 42 ``` Note that you should not place setup code inbetween the module header (`module -... where`) and import declarations. GHC will not be able to parse it (issue - #167). It is best to place setup code right after import declarations, but due -to its declarative nature you can place it anywhere inbetween top level -declarations as well. +... where`) and import declarations. GHC will not be able to parse it ([issue + #167](https://github.com/sol/doctest/issues/167)). It is best to place setup +code right after import declarations, but due to its declarative nature you can +place it anywhere inbetween top level declarations as well. ### Multi-line input