我用關於Interotube一些文件,沒有項目,而我的全局(或本地stack.yaml)是:ghci中/堆棧和包裝
~/.stack/global
$ cat stack.yaml
flags: {}
packages: []
extra-deps: []
resolver: lts-8.21
如果我stack exec -- ghci
和:l Intero.hs
其中Intero.hs
包含:
$ cat Intero.hs
module Intero where
import Control.Lens.Lens
我得到:
$ stack exec -- ghci
GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /Users/nrolland/.emacs.d/.ghci
Prelude
λ> :l Intero.hs
[1 of 1] Compiling Intero (Intero.hs, interpreted)
Intero.hs:3:1: error:
Failed to load interface for ‘Control.Lens.Lens’
Use -v to see a list of the files searched for.
Failed, modules loaded: none.
我重新啓動與-v:
$ stack exec -- ghci -v
GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help
Glasgow Haskell Compiler, Version 8.0.2, stage 2 booted by GHC version 7.10.3
Using binary package database: /Users/nrolland/.stack/programs/x86_64-osx/ghc-8.0.2/lib/ghc-8.0.2/package.conf.d/package.cache
Using binary package database: /Users/nrolland/.stack/snapshots/x86_64-osx/lts-8.23/8.0.2/pkgdb/package.cache
Using binary package database: /Users/nrolland/Sync/clones/haskGist80/.stack-work/install/x86_64-osx/lts-8.23/8.0.2/pkgdb/package.cache
loading package database /Users/nrolland/.stack/programs/x86_64-osx/ghc-8.0.2/lib/ghc-8.0.2/package.conf.d
loading package database /Users/nrolland/.stack/snapshots/x86_64-osx/lts-8.23/8.0.2/pkgdb
loading package database /Users/nrolland/Sync/clones/haskGist80/.stack-work/install/x86_64-osx/lts-8.23/8.0.2/pkgdb
wired-in package ghc-prim mapped to ghc-prim-0.5.0.0
和加載Intero.hs
的時候,我得到
Intero.hs:3:1: error:
Failed to load interface for ‘Control.Lens.Lens’
Locations searched:
Control/Lens/Lens.hs
Control/Lens/Lens.lhs
Control/Lens/Lens.hsig
Control/Lens/Lens.lhsig
Upsweep partially successful.
*** Deleting temp files:
Deleting:
Failed, modules loaded: none.
loading package database /Users/nrolland/.stack/programs/x86_64-osx/ghc-8.0.2/lib/ghc-8.0.2/package.conf.d
loading package database /Users/nrolland/.stack/snapshots/x86_64-osx/lts-8.23/8.0.2/pkgdb
loading package database /Users/nrolland/Sync/clones/haskGist80/.stack-work/install/x86_64-osx/lts-8.23/8.0.2/pkgdb
wired-in package ghc-prim mapped to ghc-prim-0.5.0.0
wired-in package integer-gmp mapped to integer-gmp-1.0.0.1
wired-in package base mapped to base-4.9.1.0
wired-in package rts mapped to rts-1.0
wired-in package template-haskell mapped to template-haskell-2.11.1.0
wired-in package ghc mapped to ghc-8.0.2
wired-in package dph-seq not found.
wired-in package dph-par not found.
但鏡頭是lts-8.23一部分,雖然當我看着它在我ghc-pkg
沒有看到它
$ stack exec -- ghc-pkg list
/Users/nrolland/.stack/programs/x86_64-osx/ghc-8.0.2/lib/ghc-8.0.2/package.conf.d
Cabal-1.24.2.0
array-0.5.1.1
base-4.9.1.0
binary-0.8.3.0
bytestring-0.10.8.1
containers-0.5.7.1
deepseq-1.4.2.0
directory-1.3.0.0
filepath-1.4.1.1
ghc-8.0.2
ghc-boot-8.0.2
ghc-boot-th-8.0.2
ghc-prim-0.5.0.0
ghci-8.0.2
haskeline-0.7.3.0
hoopl-3.10.2.1
hpc-0.6.0.3
integer-gmp-1.0.0.1
pretty-1.1.3.3
process-1.4.3.0
rts-1.0
template-haskell-2.11.1.0
terminfo-0.4.0.2
time-1.6.0.1
transformers-0.5.2.0
unix-2.7.2.1
xhtml-3000.2.1
/Users/nrolland/.stack/snapshots/x86_64-osx/lts-8.23/8.0.2/pkgdb
(no packages)
/Users/nrolland/Sync/clones/haskGist80/.stack-work/install/x86_64-osx/lts-8.23/8.0.2/pkgdb
(no packages)
如何輕鬆加載模塊而無需創建完整的項目? 這可能是容易的,但我對整個事情是如何工作的很迷茫..
您是否安裝了包裝? '堆棧安裝鏡頭'。 –
工作。謝謝。你可以把這個作爲一個答案...有沒有一種方法來「安裝」所有的LTS 8.23自動?? – nicolas