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
3
votes
2 answers

Haskell function that takes out last occurrence of input character

I'm having trouble writing this function that takes a character and a list of characters, then eliminates the last occurrence of that input character in the list. I was able to take out the first occurrence of the input character with my function…
T-Bird
  • 187
  • 1
  • 4
  • 20
2
votes
1 answer

Hlint integration with (Win)GHCi

Using Hlint via the command prompt works for me, but I have problem trying to perform the GHCi integration. http://community.haskell.org/~ndm/darcs/hlint/hlint.htm says that "the script is at hlint.ghci [link], and a copy is installed locally in…
efie
  • 544
  • 5
  • 22
2
votes
1 answer

Haskell: Creating record of list of string and pair of

How to create a record of list of string and, pair of in Haskell I tried the following For creating a record of list of string data testList = test [string] deriving (Show, Eq) When I run it, it gives me the following error Not a data…
veda
  • 6,416
  • 15
  • 58
  • 78
2
votes
1 answer

How can I compare and return data using a list of data

I'm a newbie to Haskell and I'm struggling to find a way to use class member variables to return the member variable I am looking for. I have this data: data Place = Place {name :: String, north :: Float, east ::…
Pepe
  • 59
  • 6
2
votes
2 answers

Haskell tuple not matching with function argument

I'm new to Haskell so it may be obvious but I did Prolog extensively so I'm perplex about this one... When using GHCi, I created the following function (1): Prelude> let find k t = head [v | (k',v) <- t, k == k'] -- Definiton of find find :: Eq a1…
lintense
  • 21
  • 3
2
votes
2 answers

Some issues when using WinGHCi

With WinGHCi, how can one implement the following code? soma :: Int -> Int soma 1 = aluno 1 soma n = aluno n + soma (n-1) I am currently writing multiline code using :{ ... :} but that doesn't seem to solve the issue, in this case. Also, why…
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
2
votes
3 answers

Haskell function that alternatively applies input unary functions

I am trying to write a Haskell function that takes two unary functions (f and g) and a list of numbers (ns) and alternatively applies those input functions f and g to the elements of the inputted list. For example: func double square [2, 3, 4, 5,…
T-Bird
  • 187
  • 1
  • 4
  • 20
2
votes
2 answers

Rewriting zipWith function using list comprehension

I've rewritten the zipWith function using recursion, and now I am trying to rewrite it using list comprehension. I have run into quite a few binding errors and I know that my second line is incorrect. This is the function I have that works like…
T-Bird
  • 187
  • 1
  • 4
  • 20
2
votes
1 answer

Haskel type declaration, function and tuple as arguments

I'm doing a haskell assignment for school. I want to make a function called MapTuple, wich maps a function with a tuple as its arguments for an array of tuple. Im declaring it on the following way: MapTuple :: [(a,b)] -> (a -> b) -> [b] the way i…
Emscape
  • 75
  • 8
2
votes
3 answers

Error to launch winghci shipped in haskell platform package 2012.2.0.0

Everytime I double click winghci.exe an error message CreateGHCiProcess failed with failed with error 2 pops. I assume the installation hasn't completed setting environment variables successfully since cmd C:\>ghci ends up with no command found…
Yang
  • 777
  • 1
  • 10
  • 19
2
votes
1 answer

Haskell : hide function in module (i.e. make function usable only by other functions in same module)

suppose I have a file NecessaryModule.hs, which has the following internals : module NecessaryModule where addNumber1 :: Int -> Int -> Int addNumber1 a b = a + b addNumber2 :: Int -> Int -> Int addNumber2 a b = a + b When I do : :load…
artella
  • 5,068
  • 4
  • 27
  • 35
1
vote
0 answers

Error with winGHCi Not in Scope

I have just started programming Haskell using Haskell Platform. I'm running winGHCi 1.0.6. I created a "basic.hs" file with the following code: square x = x * x I create a folder under Haskell Platform and saved the "basic.hs" there. Then when I…
sree
  • 33
  • 4
1
vote
0 answers

How to install WinGHCi?

I used to learn Haskell before I uninstalled everything. Now, I downloaded the Haskell platform but it seems there's no WinGHCi. Any suggestion please to solve the issue? I tried to install it manually but there is no .exe file.
Tn25zm
  • 11
  • 2
1
vote
1 answer

Input redirection in WinGHCi

I know I can do the following from a command prompt: $ runghc WC < quux.txt How do I do this in WinGHCi? I know I have to first load the file like this: Prelude> :load WC But then what? This doesn't work: *Main> WC < quux.txt :1:1:…
Paul Reiners
  • 8,576
  • 33
  • 117
  • 202
1
vote
3 answers

Convert a list of digits to a number HASKELL

I want to make a function in haskell that given a list of single digits, i make the full number. I was thinking in using intensive lists and patrons, as the code it follows: funcion5 (x:xs) = [y*(10^w) | y <- (x:xs) w] The idea is, to go over the…
vps
  • 90
  • 10