Skip to content

Commit

Permalink
Enhance README with explanation concerning issue #167.
Browse files Browse the repository at this point in the history
  • Loading branch information
kindaro committed Jan 23, 2018
1 parent 438ec5a commit b42525e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ Here is an example:

```haskell
module Foo where

import Bar.Baz

-- $setup
-- >>> let x = 23 :: Int

Expand All @@ -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:
Expand Down

0 comments on commit b42525e

Please sign in to comment.