commercialhaskell / commercialhaskell/stack

Feature request: Ability to launch repl for a script with experimental import parser

Open
#3,214 2 comments 1 reaction 0 assignees View on GitHub
awaiting pull request component: ghci type: enhancement
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

Right now, there's a wonderful script parser implemented as a part of https://github.com/commercialhaskell/stack/issues/2805 which lets you write scripts like this:

```haskell
#!/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.

Contributor guide

Open the contributing guide

Research direction

Start by reading the script-parser context in issue #2805, then locate Stack's existing script and REPL entry points. Determine how a command could launch a REPL that parses imports and loads the selected file; done means the requested script example can be opened in that REPL.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.