Question: is there a way where a construct like (pseudo code):

```
test (a,b) = if a > 10 then a else null

```

in Haskell. If you map over a list I can use `filter` to do this, but I would like a similar construct using `if then else`.

Answer: 
Haskell has no null references, but that doesn't mean that you can't model the presence or absence of values. You typically use the `Maybe` type for that, with the data constructors `Just` for values and `Nothing` instead of null.

You could write your function like this:

```
test (a,b) = if a > 10 then Just a else Nothing

```

Here's how to interact with it:

```
Prelude> test (11, "foo")
Just 11
Prelude> test (10, "foo")
Nothing

```

The type of the function is:

```
test :: (Ord a, Num a) => (a, b) -> Maybe a

```

It obeys the rule that both the `then` and the `else` branch returns a value of the same type - in this case the type is `Maybe a`.
`if...else` is an expression in Haskell and must always evaluate to a value. Furthermore, both branches must evaluate to a value **of the same type**. So the `else` branch must evaluate to the same type as `a` for your code to work.

In the case of `filter`, the result must be a list. We can implement `filter` using `if...else`. The idea here is that if the condition is true, then we want to include the element in the resulting list. If not, then we want to continue filtering on the rest of the list.

```
filter _ [] = []
filter f (x:xs) = if f x then (x:f xs) else f xs

```

Note that in both cases, **the result is a list**. We remove an item by **not including it in the returned list**.