haskell - 配置堆栈 ghci 提示符

标签 haskell read-eval-print-loop ghci haskell-stack nixos

是否可以配置stack ghci类似于ghci的方式通过 ~/.ghci 配置文件?

目前stack ghci不接受 ~/.ghci 中的设置文件。

我正在研究将提示设置为 lambda 而不是加载的模块:

:set prompt "\ESC[33m\STXλ> \ESC[m\STX"

更新

[neo@nixos:~/HaskellLearning/IdeTest]$ stack ghci The following GHC options are incompatible with GHCi and have not been passed to it: -threaded Configuring GHCi with the following packages: IdeTest Using main module: 1. Package `IdeTest' component exe:IdeTest-exe with main-is file: /home/neo/HaskellLearning/IdeTest/app/Main.hs GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/neo/HaskellLearning/IdeTest/.ghci Loaded GHCi configuration from /home/neo/.ghci [1 of 9] Compiling Ch13
( /home/neo/HaskellLearning/IdeTest/src/Ch13.hs, interpreted ) [2 of 9] Compiling Ch15 ( /home/neo/HaskellLearning/IdeTest/src/Ch15.hs, interpreted ) [3 of 9] Compiling Ch17 ( /home/neo/HaskellLearning/IdeTest/src/Ch17.hs, interpreted ) ... Ok, 9 modules loaded. Loaded GHCi configuration from /run/user/1000/ghci31082/ghci-script *Main Ch13 Ch15 Ch17 Functor HelloError Lib Phone SemigroupAndMonoid>



提到的其他 2 个配置都没有对更改提示做任何事情。

最佳答案

尝试将您的配置放在:

~/.ghc/ghci.conf

在 Ubuntu 16.04 上为我工作。

关于haskell - 配置堆栈 ghci 提示符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48895340/

相关文章:

Haskell,顺序程序流程?

scala - 使用字符串列表作为参数的 Files.write 在 Scala REPL 中失败 (2.10.5)

Clojure 和 ClojureScript REPL 产生不同的输出

haskell - 与 Haskell 中的 `System.Directory` 混淆

Haskell/GHCi - 从不同目录加载模块

haskell - 如何为任一类型创建仿函数定义

haskell - 手动推导类型 `(.) (foldr(++)) (map (:))`

Haskell:GHCi 将 Ctrl-Y 视为 Ctrl-Z

user-interface - 函数式 GUI 编程可能吗?

go - 如何从标准输出返回值?