Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command ls or dir in ghci

Tags:

haskell

ghci

I'm new to Haskell.

I'm using ghci. I know I can move through directory with the command :cd <dir>. But I cannot find the command to list the files in a directory (something like Unix ls or Microsoft dir).

Is it possible to do it in GHCI?

Thank you

like image 260
Aslan986 Avatar asked May 31 '12 16:05

Aslan986


People also ask

How do I change directory in Haskell?

Then start up Haskell, use the :cd command to change to your home directory or subdirectory, then the :load command to load the file. Try things out. If you want to edit your file, do so and save it, and then back in Haskell reload the file using :reload.

How do I load files into ghci?

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 run a Haskell file in ghci?

Open a command window and navigate to the directory where you want to keep your Haskell source files. Run Haskell by typing ghci or ghci MyFile. hs. (The "i" in "GHCi" stands for "interactive", as opposed to compiling and producing an executable file.)


2 Answers

You can call bash command :!ls.

like image 144
ДМИТРИЙ МАЛИКОВ Avatar answered Sep 18 '22 12:09

ДМИТРИЙ МАЛИКОВ


:show paths

type :? for help in GHCI; at the bottom, there's a Commands for displaying information heading

like image 22
Marc Avatar answered Sep 17 '22 12:09

Marc