# Parse error but no mismatched brackets or incorrect indentation

**URL:** <https://discourse.haskell.org/t/parse-error-but-no-mismatched-brackets-or-incorrect-indentation/878>\
**Category:** Learn\
**Created:** [September 13, 2019, 7:50pm UTC](https://discourse.haskell.org/t/parse-error-but-no-mismatched-brackets-or-incorrect-indentation/878 "2019-09-13T19:50:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Franpg995](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@Franpg995](https://discourse.haskell.org/u/Franpg995)\
**Post date:** [September 13, 2019, 7:50pm UTC](https://discourse.haskell.org/t/parse-error-but-no-mismatched-brackets-or-incorrect-indentation/878/1 "2019-09-13T19:50:31Z")

</div>

Hello, I’m getting this error

 ![Screenshot_2019-09-13_16-37-47](https://us1.discourse-cdn.com/flex002/uploads/haskell/original/1X/9c1f32fd7808ce83b95e87ffd46e7c83615d8560.jpeg)

Where my code is

```haskell
 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.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![gilmi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/gilmi/32/45_2.png) [@gilmi](https://discourse.haskell.org/u/gilmi)\
**Post date:** [September 13, 2019, 8:09pm UTC](https://discourse.haskell.org/t/parse-error-but-no-mismatched-brackets-or-incorrect-indentation/878/2 "2019-09-13T20:09:39Z")

</div>

your If Expression is missing the `else` clause. In Haskell, `if` is always of the form `if <predicate> then <expr> else <expr>`.

---

<div class="post-metadata">

**Author:** ![Franpg995](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@Franpg995](https://discourse.haskell.org/u/Franpg995)\
**Post date:** [September 13, 2019, 8:28pm UTC](https://discourse.haskell.org/t/parse-error-but-no-mismatched-brackets-or-incorrect-indentation/878/3 "2019-09-13T20:28:37Z")

</div>

Oh… well that was dumb from my part. Thank you

---

<div class="post-metadata">

**Author:** ![bradrn](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/bradrn/32/264_2.png) [@bradrn](https://discourse.haskell.org/u/bradrn)\
**Post date:** [September 15, 2019, 5:09am UTC](https://discourse.haskell.org/t/parse-error-but-no-mismatched-brackets-or-incorrect-indentation/878/4 "2019-09-15T05:09:54Z")

</div>

@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`?)
