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

cabal new-repl without a project #5425

Closed
int-index opened this Issue Jul 11, 2018 · 4 comments

Comments

Projects
3 participants
@int-index
Contributor

int-index commented Jul 11, 2018

Sometimes I just need to check a couple of things in GHCi, not specific to any project. I could run ghci, but then I don't get access to any packages except the ones that are installed globally.

With stack I can run stack ghci --package lens, for instance.

With cabal I have to create something like this:

cabal-version: 2.2
name: global
version: 0

library
  build-depends: base, lens
  default-language: Haskell2010

and then run cabal new-repl in a directory with this .cabal-file.

I'd prefer to write cabal new-repl --package lens:

  • it would find a suitable build plan for the specified packages and launch GHCi in this environment
  • it would not create dist-newstyle in the current directory, instead it could use ~./cabal/dist-global or similar
@int-index

This comment has been minimized.

Show comment
Hide comment
@int-index

int-index Jul 11, 2018

Contributor

another possible syntax:

cabal global repl --build-depends "lens, aeson"

maybe we could add other commands in the future to the global namespace, e.g. cabal global build, cabal global run, etc, but let's focus on the REPL for now.

Contributor

int-index commented Jul 11, 2018

another possible syntax:

cabal global repl --build-depends "lens, aeson"

maybe we could add other commands in the future to the global namespace, e.g. cabal global build, cabal global run, etc, but let's focus on the REPL for now.

@hvr

This comment has been minimized.

Show comment
Hide comment
@hvr

hvr Jul 11, 2018

Member

@int-index you can try https://github.com/hvr/cabal-env for now, which is supposed to be a UI prototyping sandbox for what a possible UI for cabal could be.

Your use-case is handled by

cabal-env -i lens aeson

Once we've gained enough experience with the cabal-env prototype we can start merging it into cabal proper. However, I'm not fully satisfied with cabal-env right now; I still need to implement a few more modes and try them out; this is also related to @typedrat's new-install work which implements a small subset of cabal-env for the library-install use-case.

PS: I don't like the cabal global idea to denote forcing a project-less context; My plan was rather to have cabal --project-file='' repl ... (or maybe some sugar flag, cabal --no-project repl ...) tell cabal to ignore any project context (i.e. ignore any cabal.project or *.cabal file in fs-scope).

Member

hvr commented Jul 11, 2018

@int-index you can try https://github.com/hvr/cabal-env for now, which is supposed to be a UI prototyping sandbox for what a possible UI for cabal could be.

Your use-case is handled by

cabal-env -i lens aeson

Once we've gained enough experience with the cabal-env prototype we can start merging it into cabal proper. However, I'm not fully satisfied with cabal-env right now; I still need to implement a few more modes and try them out; this is also related to @typedrat's new-install work which implements a small subset of cabal-env for the library-install use-case.

PS: I don't like the cabal global idea to denote forcing a project-less context; My plan was rather to have cabal --project-file='' repl ... (or maybe some sugar flag, cabal --no-project repl ...) tell cabal to ignore any project context (i.e. ignore any cabal.project or *.cabal file in fs-scope).

@int-index

This comment has been minimized.

Show comment
Hide comment
@int-index

int-index Jul 11, 2018

Contributor

@hvr thank you, cabal-env indeed works well for my needs. Looking forward to having this functionality in cabal.

Contributor

int-index commented Jul 11, 2018

@hvr thank you, cabal-env indeed works well for my needs. Looking forward to having this functionality in cabal.

@hvr

This comment has been minimized.

Show comment
Hide comment
@hvr

hvr Jul 11, 2018

Member

@int-index btw, please feel free to suggest enhancements to cabal-env; it's really supposed to be a playground for UI experimentation.

Member

hvr commented Jul 11, 2018

@int-index btw, please feel free to suggest enhancements to cabal-env; it's really supposed to be a playground for UI experimentation.

@typedrat typedrat self-assigned this Jul 23, 2018

@typedrat typedrat moved this from To-Do to In Progress in Have new-build become build (GSOC2018) Jul 24, 2018

@typedrat typedrat moved this from In Progress to Needs Review in Have new-build become build (GSOC2018) Jul 27, 2018

@typedrat typedrat moved this from Needs Review to In Progress in Have new-build become build (GSOC2018) Jul 27, 2018

@typedrat typedrat moved this from In Progress to Needs Review in Have new-build become build (GSOC2018) Jul 27, 2018

@typedrat typedrat moved this from Needs Review to Done in Have new-build become build (GSOC2018) Jul 29, 2018

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