Questions tagged [winghci]

Questions regarding WinGHCi - Windows GUI for GHCi

WinGHCi is a simple GUI to run (the Glasgow Haskell Interpreter) on Windows.

Resources:

46 questions
34
votes
4 answers

How to see the current working directory in WinGHCi

I've started to teach myself Haskell, and for that I've installed The Haskell Platform for Windows. I'm using WinGHCi as of now. I learned that it has command :cd which is used to change directory. But the question is, how would I know which…
Nawaz
  • 353,942
  • 115
  • 666
  • 851
16
votes
2 answers

Haskell : display/get list of all user defined functions

Is there a command in Haskell which displays (or get as a list of) all the user defined functions which have been loaded/defined in the GHCi? Thanks
artella
  • 5,068
  • 4
  • 27
  • 35
14
votes
2 answers

Haskell : understanding "No instance for" error messages in ghci

Question 1 Hi, if in WinGHCi I intentionally do the following wrong piece of code : 3 4 Then the error message I get is :1:1: No instance for (Num (a0 -> t0)) arising from the literal `3' Possible fix: add an instance…
artella
  • 5,068
  • 4
  • 27
  • 35
12
votes
2 answers

Haskell : can only load one file at a time via :load

suppose I have two modules NecessaryModule1 & NecessaryModule2 (as outlined in the post Haskell : loading ALL files in current directory path. Then I have noticed in both WinGHCi and GHCi that if I do : > :load NecessaryModule1 [1 of 1] Compiling…
artella
  • 5,068
  • 4
  • 27
  • 35
8
votes
2 answers

How can I insert a backtick in GHCi?

I'm trying out Haskell in GHCi on Windows. In the tutorial I'm following, a function name is enclosed in backticks: x `mod` 7. However, I can't enter the character in GHCi. The backtick character has ASCII value 096, but GHCI does not allow Alt +…
Martin
  • 1,430
  • 10
  • 19
8
votes
1 answer

WinGHCi won't start

So, I tried to ":set prompt "λ> "" in WinGHCi, it crashed and after that wouldn't start again (Not Responding). I reinstalled the Haskell Platform and it still won't start (Not Responding). GHCi works in cmd. I searched for remaining .conf files…
rzr
  • 144
  • 2
  • 6
7
votes
4 answers

How do I access a list element I've added with the cons (:) operator?

I'm new to Haskell (and functional programming in general) and was wondering how I can access a new element that I've added to a list using the cons (:) operator? For example, using WinGHCi I create a new list and access the first element: ghci> let…
Awesominator
  • 130
  • 10
7
votes
2 answers

Clearing WinGhci's command prompt (and also its values)

How can I clear WinGhci's (one of Haskell's Windows IDEs) command prompt and all the current "session" values?
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
7
votes
1 answer

Haskell : unload module in WinGHCi

I loaded two modules (NecessaryModule1.hs and NecessaryModule2.hs as outlinked in Haskell : loading ALL files in current directory path). Now I want to unload NecessaryModule2.hs. I found an 'unload' function in System.Plugins.Load however but it…
artella
  • 5,068
  • 4
  • 27
  • 35
5
votes
1 answer

Compiling Haskell code in Cygwin, and some other bugs in Haskell Platform on Windows

I am trying to compile a simple hello world program in Haskell, with Haskell Platform 2011.2.0.1. If I load the code in WinGHCi, and use the GUI to compile, the .exe is created. Then I can run the .exe from Cygwin. But if I try to compile the code…
R71
  • 4,283
  • 7
  • 32
  • 60
5
votes
1 answer

How is it possible GHCI displays used memory of bigger value than I physically have?

The basic question comes along with the quotes from the GHCI interpreter. Yes, I know that the supposed use of code is compiling it into executable, however, as I am a beginner in Haskell, GHCI seems to be perfect to learn some Haskell. When I use…
Nick M
  • 91
  • 6
5
votes
1 answer

Getting Source Files to Run in Haskell Programming (WinGHCi)

I can't figure out how to get WinGHCi to load and compile my .hs file. I have a file, C:\Users\Haskell\Source\hello.hs, that only contains the following line: main = putStrLn "Hello, world!" If, at the Prelude> prompt, I run :cd…
Joffrey Baratheon
  • 494
  • 1
  • 5
  • 19
5
votes
1 answer

How to set the working directory of WinGHCi

I just installed WinGHCi. When I try to load an .hs file with Ctrl+L, it opens the file browser in C:\Program Files (x86)\Haskell Platform\2012.2.0.0\winghci which is where I installed this. I don't want it to go there by default, I keep my code…
Superbest
  • 25,318
  • 14
  • 62
  • 134
5
votes
2 answers

Haskell : loading ALL files in current directory path

The command (in GHCi) :load abc Loads the functions in the file abc (which must exist in the current directory path). How would I load all the files in the current directory path?…
artella
  • 5,068
  • 4
  • 27
  • 35
3
votes
3 answers

haskell: creating list of records

How to create a list of records in haskell I have a Record data TestList = Temp1 (String,[String]) | Temp2 (String,[(String,String)]) deriving (Show, Eq) I am creating a list of records testLists :: [TestList] testLists = …
veda
  • 6,416
  • 15
  • 58
  • 78
1
2 3 4