Skip to content

Is cabal repl TARGET possible on starting ghci? #1840

Open
@borgauf

Description

@borgauf

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions