haskell / haskell/haskell-mode

Is cabal repl TARGET possible on starting ghci?

Open
#1,840 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Emacs Lisp
Stars
1.4k
Forks
354
Avg merge
5d 10h
Merged PRs (30d)
2

Description

If I am in a Haskell project directory and have added packages to my executable build-depends section, is it possible to start haskell-mode REPL with the cabal command

cabal repl TARGET

or

cabal repl --build-depends "vector >= 0.12 && < 0.13"

IOW, I want to start the haskell-mode session with a REPL that can access exactly what my project has for (Hackage) packages and modules. I see the haskell-process-path-cabal variable, but don't know how to configure it in my init file. Again, basically, I just want the same Hackage packages (e.g. QuickSort, hmatrix, etc. that I've added to my regular project to be available in a haskell-mode ghci session. I set everything Haskell up with ghcup, BTW. I've tried in a terminal REPL session

λ> :set -package hmatrix
package flags have changed, resetting and loading new packages..

I try

λ> import Numeric.LinearAlgebra
λ> m = (3><4) [1..] :: Matrix Double
λ> m
(3><4)
[ 1.0, 2.0, 3.0, 4.0
, 5.0, 6.0, 7.0, 8.0
, 9.0, 10.0, 11.0, 12.0 ]

But none of this works with haskell-mode's REPL interpreter

λ> :set -package QuickCheck
cannot satisfy -package QuickCheck
(use -v for more information)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.