Error: parse error on input '|'

2

libreDeCuadrados :: Integer -> Bool
libreDeCuadrados x = sumaPrimos x 2 0
  where 
    sumaPrimos x c s
               | c == x && s == x = True  -- Caso Base 1
               | c == x && s /= x = False -- Caso Base 2
               | x 'mod' c == 0 && sumaPrimos x (c+1) (s+c) && esPrimo c
               | otherwise = sumaPrimos x (c+1) s

I have this code and it gives me the error that appears in the title. Can someone help me?

    
asked by Alejandro Sánchez 24.10.2017 в 20:59
source

2 answers

0

A = is missing in the third case ..

    
answered by 24.10.2017 / 21:29
source
0

Yes, as Fydor says there is a = in the third case. Complete would be so x mod c == 0 && sumaPrimos x (c+1) (s+c) && esPrimo c = True (if the rest of dividing c between x and the function sumaPrimos that takes as numbers the contents of the variables x the next of c and the sum of s + c and the function esPrimo applied to the variable c = True, which would have a lot of logic because the signature of the function says that it has to return a Bool P.S. I assume that the function esPrimo is defined.

    
answered by 24.10.2017 в 22:26