Linked Questions

0 votes
1 answer
77 views

How do I specify an abstract syntax of different language constructs in an already existing language?

I'm trying to solve a problem of specifying an abstract syntax of different language constructs such as variable declaration, array declaration, if-else statements and so on in Haskell, but I'm ...
-2 votes
1 answer
84 views

Parse error, possiby identation or mismatch brackets

I'm writing a program in haskell but I doesn't get rid of an error: mountTree :: [Char] -> FilePath -> Int -> Either IO [FilePath] String mountTree promatiList toScan 0 = do b <- ...
-1 votes
1 answer
81 views

How can I save a list of tuples across different functions

I want to write a file that has information about when I can schedule an exam, the date(given a limit of days for all the exams) and which room(given a limited number of rooms) but the exam subject is ...
2 votes
2 answers
800 views

Histogram of Oriented Gradients In Haskell

I have never written a single line of Haskell code (except for random stuff in my xmonad configuration file), but I thought the perfect way to learn functional programming is by doing. I want to write ...
-1 votes
1 answer
124 views

parse error on input `=' Perhaps you need a 'let' in a 'do' block?

When i was writing my first program in Haskell i got this as an error.Please help me.Here's the code: main = do { n <- getLine; getInt :: String -> Int; getInt n = digitToInt n; if n == ...
0 votes
1 answer
59 views

Trying to generate a list of pseudo random Integers

I am trying to create an Int list of random numbers which is made by taking 62 numbers from another list of 1000 random numbers starting from a random index which is one of the inputs to the function. ...
122 votes
16 answers
22k views

Beginners Guide to Haskell? [closed]

I've been looking for a decent guide to Haskell for some time, but haven't been able to find one that seems interesting enough to read through and/or makes sense. I've had prior exposure to Haskell a ...
-4 votes
1 answer
184 views

If length is 2 do Haskell [closed]

I'm new to Haskell and I'm not sure how to work around the If-Else, for example: function str = if ((length str) = 2) then (....) In java we would: if (str.length =2){ str = "2"} else { ...
1 vote
3 answers
98 views

First Haskell program not launching

I have written my first Haskell code in Visual Studio Code. I want to implement list of lists so I started with simple list. module Main where import System.Environment import Data.List import Data....
-1 votes
1 answer
126 views

What does a stand for in a data type declaration?

Normally when using type declarations we do: function_name :: Type -> Type However in an exercise I am trying to solve there is the following structure: function_name :: Type a -> Type a or ...
0 votes
4 answers
217 views

Weird type syntax in data constructor [duplicate]

I've found some code data Tree c a = Node String [Tree c a] | NodeWithCleanup c [Tree c a] | Leaf a And I don't understand why it's necessary to add [Tree c a]. I don't ...
1 vote
1 answer
126 views

Problems with mismatched Types in Haskell and where to find good guides [closed]

firstly i want to ask where can i look to improve my skills with haskell, whenever i get stuck i cant find relevant tutorials or anything to help me, im using trial and error to figure out syntax for ...
2 votes
2 answers
1k views

HASKELL The lambda expression ‘\ xs -> ...’ has one argument, but its type ‘[t]’ has none

We had to write lambda function in Haskell but it always shows errors. What do I do wrong? all codes have the same kind of error, but I don't understand how to make them right. length' :: [a] -> [...
1 vote
1 answer
662 views

concatenate getLine input with haskell array throws a type error

im totally beginner at Haskell i came from js environment , i have a simple array students into which i want to push some student objects but sadly Haskell does not support objects ( if there is a way ...
3 votes
2 answers
138 views

First experience with monads (Haskell)

I apologize for the subject being unclear. I'm doing Haskell 99 as a beginner, and have encountered the concept of monad first time in my life in the solution to 67A. The part of the problem I'm ...

15 30 50 per page