padron_Docente ((Per nom dni año rol):xs) = if rol == Docente _ then (nom, dni):padron_Docente xs
If i add more lines to the document the error goes to the last line, if i comment or delete that line of code the error goes away but if i write it again the error comes back. I’m using notepadqq but also tried saving the file with mousepad and the error still there.
I have been editting the document the whole day and no problems until now.
@Franpg995 You may be interested to know the reason why every if expression must be accompanied by an else. (Or you may not, but I’ll explain just in case!) In other languages, an if encloses a block, so you can just skip execution of the block if the condition isn’t satisfied. But in Haskell, an if is an expression, which evaluates to a value, so you have to have a value to use when the condition isn’t satisfied. (For example, what would be the value of if False then 1?)