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

allow scripts to have any name (not just Main.hs) #5702

Closed
fommil opened this issue Nov 21, 2018 · 1 comment · Fixed by #7917
Closed

allow scripts to have any name (not just Main.hs) #5702

fommil opened this issue Nov 21, 2018 · 1 comment · Fixed by #7917

Comments

@fommil
Copy link
Contributor

fommil commented Nov 21, 2018

I would love it if I could have a persistent file called scratch.hs that I keep in my ~/.emacs.d that I can execute as a script. But deep inside the script logic it generates a fake name Main.hs regardless of the file name. This unfortunately breaks the haskell-mode's haskell-compile jump-to-error support because the filenames don't match.

As a workaround, I call it Main.hs, which is no biggy, but it'd be a pretty sweet workflow optimisation to be able to have a scratch.hs file! We could even add support in haskell-mode to generate / popularise this file. Possibly add special handling so it always gets compiled the correct way and perhaps even a special new-repl launcher too.

It would also be really great for performance reasons to be able to short stop of generating the binaries. Often I just want to check for compilation.

// @typedrat I'm guessing you know the most about this than anybody 😄

@typedrat
Copy link
Collaborator

The obvious way to do it would be to support main-is, with the file being named based on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants