-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stack ghci
doesn't let me use modules from executables
#347
Comments
This is because
Anyway, I can make it load everything on start-up by default and add a flag like |
+1 for loading everything by default |
Great! I didn't realize specific modules could be loaded with |
Also, I don't know if it is related, but is it possible to load modules that only exist in tests as well? For example, with cabal I could run I asked a similar question on reddit. |
Currently all libraries are available from all targets, so you should just be able to |
Okay, thanks! That solves all my problems. I'm okay with this being closed unless more people want the feature where everything is loaded by default. I guess I'm neutral on the matter. It might be nice for people like me who expect to just be able to do something like |
Let's keep it open, I think other people want the loading by default thing. |
Should be resolved on master. Please retry. Note: It will only load "modules". It won't load Main modules for the executable or bench marks or test suites, because they conflict. So for that you should load the filename manually with |
@chrisdone: This isn't working for me for some reason. I tried it with lens, but I am getting the following error: $ stack ghci
Configuring GHCi with the following packages: lens
GHCi, version 7.10.1: http://www.haskell.org/ghc/ :? for help
<command line>: cannot satisfy -package criterion
(use -v for more information)
$ Do you have any idea what could be going on? Here's the steps I took to test it with the lens library: # get lens-4.11
$ stack unpack lens-4.11
# create a suitable stack.yaml file
$ cat stack.yaml
flags: {}
packages:
- '.'
extra-deps:
- bifunctors-5
- semigroupoids-5.0.0.2
- profunctors-5.1.1
- free-4.12.1
resolver: nightly-2015-06-11
$ stack build
...
In-place registering lens-4.11...
lens-4.11: install
Installing library in
/home/illabout/temp/what/lens-4.11/.stack-work/install/x86_64-linux/nightly-2015-06-11/7.10.1/lib/x86_64-linux-ghc-7.10.1/lens_DA5uGsy5YTc4IwqrVVp2WP
Registering lens-4.11...
Completed all 7 actions.
$ stack ghci
Configuring GHCi with the following packages: lens
GHCi, version 7.10.1: http://www.haskell.org/ghc/ :? for help
<command line>: cannot satisfy -package criterion
(use -v for more information)
$ |
Oh yeah, my stack version looks like it should have your commits: $ stack --version
Version 0.1.0.0, Git revision f724a32d5e3a727194eeab246695d7fd46f98374 (dirty)
$ |
Also, unlike #394, I don't think I have anything in my -- Make the prompt a little more colorful.
:set prompt "\001\ESC[01;35m\002%s \001\ESC[01;34m\002> \001\ESC[m\002"
:set prompt2 "\001\ESC[01;35m\002%s \001\ESC[01;31m\002| \001\ESC[m\002"
-- OverloadedStrings is often useful.
:set -XOverloadedStrings
-- Scoped type variables is often useful so we can specify the types
-- of variables (for example, in lambda expressions).
:set -XScopedTypeVariables
-- Import Prelude. Some projects don't import the Prelude by default, but
-- we are using types and functions from the Prelude in the following hoogle
-- function definition, so we need to make sure that Prelude is imported.
import Prelude
-- give us a `hoogle` function to if the hoogle binary is available.
:def hoogle \s -> return $ ":! hoogle --count=15 \"" ++ s ++ "\""
-- Show the types of evaluated expressions
:set +t
-- Enable multi-line expressions with :{ and :}
:set +m |
Probably because lens requires stack in its benchmark target which I set to be enabled by default when resolving dependencies. Choices:
|
I'm sorry, I don't have enough knowledge of cabal/stack/ghc to comment intelligently on which choice is the best. As an end user, I would like |
|
@snoyberg What do you think? I'm leaning towards |
Ah, I think I understand now.
I think you mean that lens requires criterion in its benchmark target? And criterion is not installed by default when just doing |
@chrisdone That sounds reasonable to me |
@cdepillabout Right, I meant requires criterion. |
Please can we load up the project dependencies as part of It would also be nice if we were able to specify cabal component, similar to |
I have a simple project that creates an executable. The executable has four modules (
Main
,Api
,Config
,Models
). Here is the project I am playing around with:https://github.com/parsonsmatt/servant-persistent
When using
cabal
, I am able to use and play around with these four modules from the repl:However, with
stack
, it looks like these modules don't get placed in the environment:Is there any way to get this to work with
stack
?The text was updated successfully, but these errors were encountered: