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`.
All answers are good.. I just would like make a small addition by reminding that while pure functions are not able to do that, Haskell allows us to perform impure actions as well, for instance in the `IO` monad. There, we are more relaxed on doing such things .

```
test :: (Num a, Ord a, Show a) => (a,b) -> IO ()
test (a,b) = when (a < 10) $ print a

λ> test (11,"boru") -- nothing happens
λ> test (9,"boru")
9

```

kind of.