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: "cabal repl" with file target #1812

Open
hellwolf opened this issue Jul 16, 2023 · 1 comment
Open

Feature request: "cabal repl" with file target #1812

hellwolf opened this issue Jul 16, 2023 · 1 comment

Comments

@hellwolf
Copy link

hellwolf commented Jul 16, 2023

I like to use "single cabal script" a lot for small examples, e.g.:

$ cat ~/Templates/cabalscript.hs:

#!/usr/bin/env cabal
{- cabal:
build-depends: base
-}

main = do
  putStrLn "Hello World!"
  _ <- readLn :: IO String
  return ()

If one could test this by typing "C-c C-l" that'd grand, since cabal pull in all the dependencies encoded in the special comments area. I suspect we need a new type for haskell-process-type?

Also any pointer to where to look at for start hacking on it?

Edit: I have found a workaround of using the filename itself as the cabal-repl target.

@hellwolf
Copy link
Author

I found a workaround nonetheless:

#!/usr/bin/env cabal
{- cabal:
build-depends: base
default-language: GHC2021
-}

main = do
  putStrLn "Hello World!"
  _ <- readLn :: IO String
  return ()

{-
Local Variables:
fill-column: 120
;; This will allow you to set the cabal-repl target to be this file directly.
haskell-process-type: cabal-repl
haskell-process-load-or-reload-prompt: t
End:
-}

With this, I would only need to do a couple of initial setup for the initial C-c C-l, and set the cabal repl target to the file name itself.

@hellwolf hellwolf changed the title Feature request: "cabal run" as a new haskell-process-type Feature request: "cabal repl" with file target Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant