Most voted "haskell" questions
Haskell is a functional programming language, with referential transparency and non-standard evaluation.
Learn more…66 questions
Sort by count of
-
0
votes0
answers108
viewsHelp with Heuristics in Haskell
Good afternoon, folks I’m having a problem here to be solved in Askell, his description is as follows: "Original Cutting Problem is the One-Dimensional Cutting Problem, which consists of cutting a…
-
0
votes1
answer64
viewsProblems with instance list in Haskell
I have a job at the facu and I have this mistake: 'decide' is not a (Visible) method of class `Char' to the code below: data Paridade = Par | Impar deriving Show class ParImpar a where decide :: a…
haskellasked 7 years, 8 months ago Willian Carlos 1 -
0
votes1
answer306
viewsString Encoding - Haskell
The following code encodes a sequence of equal characters, replacing the sequence with ! na, where n is the number of times the character a is repeated. Note that it only compresses sequences…
-
0
votes1
answer43
viewsHow to use Jquery in Yesod Haskell
I am just trying to display a div with the login fields {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE QuasiQuotes #-} {-#…
-
0
votes1
answer104
viewsLeaf Trees - Height
It is customary to define trees where information is only on extermidities (Leaf Trees): data LTree a = Tip a | Fork (LTree a) (LTree a) Define the following function about this type: ltHeight ::…
haskellasked 7 years ago João Sampaio 125 -
0
votes1
answer52
viewsTransformation of Trees
Considering the structures: data BTree a = Empty | Node a (BTree a) (BTree a) data LTree a = Tip a | Fork (LTree a) (LTree a) data FTree a b = Leaf b | No a (FTree a b) (FTree a b) Set the function…
haskellasked 7 years ago João Sampaio 125 -
0
votes0
answers194
viewsDoubts about normalization of polynomials
I set the function normalizes that given a polynomial, returns the corresponding polynomial, after normalization. Example: normaliza [(1,2),(3,4),(3,2)] [(4,1),(3,4)] type Polinomio = [Monomio] type…
haskellasked 6 years, 11 months ago João Sampaio 125 -
0
votes1
answer107
viewsDoubt, mistake Haskell
I want to sum the values of a list of lists in Haskell using the map function, but of the error. Type error gastoEmpresa :: [[Float]] -> Float gastoEmpresa xss = map(map sum xss)…
-
0
votes1
answer276
viewsHow to call an assist function without passing the parameter through the main function
I’m trying to solve some basic Haskell problems, but I’m having a hard time. I implemented the following code: type Nome = String type Preco = Int type CodigoBarra = Int type BancoDeDados =…
haskellasked 6 years, 9 months ago Gustavo Cruz 129 -
0
votes0
answers114
viewsFold into a binary tree in Haskell
Hello, I am trying to define the foldTree function that receives a function and a binary polymorphic tree as parameters and returns the resulting value of accumulating the application of this…
-
0
votes0
answers33
viewsHow to implement paging in Yesod?
I have a problem. I need this code below to return a specific amount of lines (Limit) from a specific number of results (Offsetby). The code of the application I’m doing for this purpose is this:…
haskellasked 6 years, 6 months ago Alexandre Nascimento 31 -
0
votes1
answer220
viewsHow to split a string with two conditions
Basically, from the string "222 2333 33", I wanted to split into several strings, when you find an empty space or a different number next to you. For example, in the string above I wanted it to be…
haskellasked 6 years, 1 month ago Joseph Smith 1 -
0
votes1
answer277
viewsBinary to decimal conversion
I made an algorithm that converts from Binary to Decimal, now I need to develop one that does the opposite. I’ll leave the code below, but this with error. Thank you. converte' :: [Int] -> Int…
-
0
votes1
answer59
viewsLibrary #include <Hsffi. h>
Hello, I am integrating a system based on C with Haskell, but I need the library #include , the content I found on the internet has not helped me in almost anything, if anyone knows something…
-
0
votes1
answer84
viewshow to create a function that checks if two lists are equal without using the operator (==)?
iguais:: [Int]->[Int]->Bool iguais [] [] = True iguais [] _ = False iguais _ [] = False iguais (x:xs) (z:zs) this is the code, I only did so far. Someone can help me?…
-
0
votes1
answer88
viewsHow to compare 2 lists and return another list with equal elements? - Haskell
My code is this comparar :: [Int] -> [Int] -> [Int] comparar [] [] = [] comparar (a:as) (b:bs) = [x | x <- as, x == b] ++ [x | x <- bs, x == a] What’s wrong with the code above?…