Skip to content
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

Feature request: An option to load stack interpreter script in ghci #2788

Closed
psibi opened this issue Nov 18, 2016 · 4 comments
Closed

Feature request: An option to load stack interpreter script in ghci #2788

psibi opened this issue Nov 18, 2016 · 4 comments

Comments

@psibi
Copy link
Member

psibi commented Nov 18, 2016

Say, I have a haskell script like this:

#!/usr/bin/env stack
{- stack
     --resolver lts-6.24
     ghci
     --package yesod-core
     --package text
-}

main = print 3

Now, I want stack to start gchi and load the related packages and the functions defined in that file.
Something like this:

stack --loadfile ~/hello.hs

Use case: While developing the script using stack, I sometimes would like to load it in ghci and inspect it's type, execute the function etc.

@harendra-kumar
Copy link
Collaborator

How about using exec ghci instead:

#!/usr/bin/env stack
{- stack
     --resolver lts-6.24
     exec ghci
     --package yesod-core
     --package text
-}

main = print 3

I had enabled this use case a while back.

@harendra-kumar
Copy link
Collaborator

This does not seem to be documented in the user guide though. It will be nice to make it more discoverable.

@psibi
Copy link
Member Author

psibi commented Nov 18, 2016

Thanks, that's exactly what I want. In fact, I read the documentation to see if something like that was available. I will leave this issue open untill someone adds this up in the documentation (or I will send a PR by this weekend.)

@psibi
Copy link
Member Author

psibi commented Mar 17, 2017

Closing the issue as the docs have been updated.

@psibi psibi closed this as completed Mar 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants