通过Haskell Stack安装了ncurses模块,但不能使用它

时间:2019-08-11 09:21:43

标签: haskell ncurses haskell-stack

我已经通过“ stack install ncurses”在全局范围内安装了ncurses模块,但是仍然无法在我的代码中使用它。有办法解决这个问题吗?

import UI.NCurses
import Data.Function (fix)
import Control.Monad (unless)

main = runCurses $ do
  setEcho False
  w <- defaultWindow
  updateWindow w $ do
    drawString "test"
  render
  fix $ \f -> do
    ev <- getEvent w Nothing
    let Just ev' = ev
    unless (ev' == EventCharacter 'q') f

我希望文件能够编译,但不会:

[1 of 1] Compiling Main             ( main.hs, main.o )

main.hs:1:1: error:
    Could not find module ‘UI.NCurses’
    Use -v to see a list of the files searched for.
  |
1 | import UI.NCurses
  | ^^^^^^^^^^^^^^^^^

0 个答案:

没有答案