Closed MatthewScholefield closed 4 years ago
Could you let me know what happens if you run plain old stack ghci
in the same directory?
Sure, running that I get a normal interactive session. One thing to note is that by default it doesn't load the base package. Not sure if this is normal since I'm new to Haskell:
$ stack ghci
Configuring GHCi with the following packages: my-package
GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /tmp/haskell-stack-ghci/2a3bbd58/ghci-script
> a = "hello"
> a
"hello"
> 12 + 2
<interactive>:3:4: error:
Variable not in scope:
(+)
:: integer-gmp-1.0.2.0:GHC.Integer.Type.Integer
-> integer-gmp-1.0.2.0:GHC.Integer.Type.Integer -> t
Running with --package base
fixes it:
$ stack ghci --package base
Configuring GHCi with the following packages: my-package
GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /tmp/haskell-stack-ghci/2a3bbd58/ghci-script
Prelude> 12 + 2
14
OK, that's very weird but probably explains why ptghci is choking. Is base
listed as a dependency in your package.yaml?
I modified it so it included base >= 4.9 && < 5
as a dependency and the behavior was the same. I've been searching for more than an hour now and can't quite figure out what's wrong with my stack ghci
but it seems like it's not a problem with ptghci. I got around it by adding ghciCommand: stack ghci --package base
to ~/.ptghci.yaml
.
I'm not sure if I'm doing something wrong, but if I run
ptghci
in a folder that has a project it just hangs:Here is the relevant output of
ptghci
when ran with-v
:Full output is here.