samedi 9 décembre 2017

Haskell: doctest: Ambiguous occurrence ‘stdout’

I've been trying to put on unit testing via doctest. Getting error:

hs-procr-0.1.0.0: test (suite: hs-procr-test)

Progress: 1/2
<interactive>:5:14: error:
Ambiguous occurrence ‘stdout’
It could refer to either ‘Turtle.stdout’,
                         imported from ‘Turtle’ at app/Main.hs:7:1-13
                         (and originally defined in ‘Turtle.Prelude’)
                      or ‘System.IO.stdout’,
                         imported from ‘System.IO’
                         (and originally defined in ‘GHC.IO.Handle.FD’)

I've got no idea why; all my *.hs files got

import System.IO hiding (FilePath, stdout, stderr)

package.yaml:

...
tests:
  hs-procr-test:
    main:                Spec.hs
    source-dirs:         test
    ghc-options:
    - -threaded
    - -rtsopts
    - -with-rtsopts=-N
    dependencies:
    - hs-procr

Spec.hs:

module Main (main) where

import Test.DocTest
import System.IO hiding (FilePath, stdout, stderr)

main :: IO ()
main = doctest [ "app/Main.hs"
               ]

I use stack, there is no *.cabal file. What have I missed?

Aucun commentaire:

Enregistrer un commentaire