Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ghci configuration file

Tags:

haskell

ghci

I'm using ghci 6.8.2 on Ubuntu. Does ghci use a configuration file where we can do some initial setup?. E.g.: :set prompt "ghci> ".

like image 713
rturrado Avatar asked Aug 02 '10 13:08

rturrado


People also ask

Where is ghci config file?

Config file locations ghc/ghci. conf. Windows: C:\Documents and Settings\<username>\Application Data/ghc/ghci. conf.

How do I run a ghci file?

GHCi is the interactive interface to GHC. From the command line, enter "ghci" (or "ghci -W") followed by an optional filename to load. Note: We recommend using "ghci -W", which tells GHC to output useful warning messages in more situations. These warnings help to avoid common programming errors.

How do I change the prompt in ghci?

Haskell Language Using GHCi Changing the GHCi default prompt The :set prompt command changes the prompt for this interactive session. To change the prompt permanently, add :set prompt "foo> " to the GHCi config file.

How do I use Haskell ghci?

If you have installed the Haskell Platform, open a terminal and type ghci (the name of the executable of the GHC interpreter) at the command prompt. Alternatively, if you are on Windows, you may choose WinGHCi in the Start menu. And you are presented with a prompt. The Haskell system now attentively awaits your input.


2 Answers

Have you tried adding :set prompt "ghci> " to ~/.ghci?

like image 193
hvr Avatar answered Oct 21 '22 00:10

hvr


Having applied @hvr's answer I got the following warning:

*** WARNING: ~/.ghci is writable by someone else, IGNORING! 

The solution is chmod g-w ~/.ghci.

like image 20
sjakobi Avatar answered Oct 21 '22 02:10

sjakobi