我想试试Writer
ghci 中的 monad。正如这里所建议的,我尝试仅使用堆栈来管理 GHC 和包,并避免全局安装。
在安装堆栈后,从全新的 Ubuntu 15.04 安装:
stack setup
mkdir lyah && cd lyah
stack new
stack install mtl
stack ghci
ghci> import Control.Monad.Writer
Could not find module ‘Control.Monad.Writer’
It is a member of the hidden package ‘mtl-2.1.3.1’.
我知道堆栈前的 ghc-pkg 用于显示/隐藏包,但我不确定如何在此处继续“取消隐藏”mtl 包。