Set prompt in Haskell

三世轮回 提交于 2019-12-20 05:45:22

问题


I'm new in Haskell

Instead of the:

Prelude>

I want GHCi to prompt

GHCi>

I wrote

:set prompt "GHCi> "

but when I close GHCi and open it again it show me

prelude

again. I saw that I need to create a file called .ghci in my home folder and set its to contents to

:set prompt "GHCi> ".

How can I create this file and set the prompt. Thank You for your answers


回答1:


You can make a .ghci file that specifies the configuration of your GHCi environment.

For a *nix system, that is often located at the ~/.ghci, for a Windows system, that is apparently located at appdata/ghc/ghci.conf where appdata is often C:/Documents and Settings/user/Application Data.

You can thus write to this .ghci (or ghci.conf) file a set of instructions to do when opening the GHC shell, like:

:set prompt "GHCi> "

GHCi will furthermore probably require to set the permissions to the file, for example on a Linux system with:

chmod go-w ~/.ghci

such that the group and other users can not write to the file.



来源:https://stackoverflow.com/questions/58780284/set-prompt-in-haskell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!