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: Ability to launch repl for a script with experimental import parser #3214

Open
k-bx opened this issue Jun 13, 2017 · 2 comments

Comments

@k-bx
Copy link
Contributor

k-bx commented Jun 13, 2017

Right now, there's a wonderful script parser implemented as a part of #2805 which lets you write scripts like this:

#!/usr/bin/env stack
-- stack --resolver lts-8.12 script
import Control.Concurrent.Async.Lifted
import Control.Monad.State.Strict

main :: IO ()
main = execStateT
    (concurrently (modify (+ 1)) (modify (+ 2)))
    4 >>= print

It would be super-nice to be able to also easily launch a REPL, which parses imports and loads the file.

@kadoban
Copy link
Collaborator

kadoban commented Jul 27, 2017

I would definitely use that.

How should it work though? Would you just run stack ghci TheFile.hs ? That already mostly works of course, the difference would be that it would pass on the --resolver and --package arguments I suppose?

And it seems like maybe it should then ignore any otherwise-applicable stack.yaml files?

Should it also imply the -hide-all-packages stuff that stack script implies?

Edit: I initially missed the import parser behavior, sorry. I see what's being requested now.

@mgsloan
Copy link
Contributor

mgsloan commented Aug 7, 2017

Should be a pretty straightforward change to Stack.Ghci! PRs appreciated!

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