Questions tagged as 'haskell'

2
answers

Material for study of functional languages: scala, haskell and erlang [closed]

Well, I asked a question recently and it was suspended because it is a matter of opinion of each person, so here I redo my question to be clearer what I want: Someone could please pass me sites or indicate books for learning the following lan...
asked by 05.01.2015 / 20:21
1
answer

What does infixr mean in Haskell?

What is and what is this infixr 3 & & amp; infixr 3 && (&&) :: Bool -> Bool -> Bool True && True = True _ && _ = False     
asked by 20.07.2016 / 16:27
1
answer

Functional Programming and Referential Transparency

Referential transparency ensures that given the same input values for a function, it will always give me the same return value. How would I have to do in the case of a function that accesses the database that has state, for example at the tim...
asked by 16.07.2015 / 01:57
1
answer

Compile File .ly

I'm compiling a program in Haskell, but it came with a .ly file, and I can not compile it. I try ghc Grammar.ly   And I get the message: ld: warning: ignoring file Grammar.ly, file was built for unsupported file format ( 0x3E 0x20 0x7...
asked by 21.03.2015 / 01:17
2
answers

How to generate the alphabet with white space between the letters?

In Haskell I can generate the alphabet as follows: alfabeto = ['a'..'z'] To display it simply: alfabeto "abcdefghijklmnopqrstuvwxyz" However, I'd like to know how I can put a space between the letters, like this: "a b c d e f g h .....
asked by 17.07.2018 / 16:35
1
answer

Verify if it is palindrome (No instance for (Eq a) arising from a use of '==')

I got the second error in the code: No instance for (Eq a) arising from a use of '==' Code: --Verifica se a lista é um palíndromo palin :: MList a -> Bool palin(x) |x==reverter(x) = True --Reversão de lista na cauda reverter:: (M...
asked by 25.05.2015 / 00:49
1
answer

Program to filter odd numbers in a list of numbers

I wrote a haskell script to find the odd numbers in a list and show them on the screen, but I get an error when it comes to displaying the results. impares[] =[] impares(x:xs) |(mod(x 2)==0) = impares xs |otherwise = x:(impare...
asked by 10.10.2015 / 22:48
1
answer

Why does not this simple Haskell code compile?

I'm studying Haskell, and I do not understand why this code does not compile: foo :: Int -> Double -> Double foo a b = a+b The error message is: Couldn't match expected type 'Double' with actual type 'Int' In the first argument of '...
asked by 01.07.2018 / 01:41
1
answer

Simple code error in Haskell

I'm starting on WinHugs, programming on Haskell. I'm new to Functional Programming. Since yesterday I am looking to solve the error that has in the code below but without success so far. Here is the code: eq2grau::(Int->Int->Int)->Int...
asked by 11.04.2015 / 16:33
1
answer

Concatenation of haskell lists by eliminating repetitions

Hello, I've been trying to make a haskell function that gives two lists a few times and returns a new list Where this new list is the union of the other two lists but without repetitions, ie a [1,2,3] [3,2,1] list should return [ 1,2,3] o...
asked by 09.05.2018 / 10:33