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`.
To filter a list with a predicate you could simply use `filter` like this

```hs
filter (>10) myList

```

but if you want to have a function that relectes in the output if the value was ok and returns the value, you can use the [`Maybe`](http://hackage.haskell.org/package/base-4.12.0.0/docs/Data-Maybe.html) type

```hs
test :: Int -> Maybe Int
test a = if a > 10 then Just a else Nothing

```

then you could filter with this function like this

```hs
catMaybes 
  $ map test
  $ myList

```

But if you just want to filter a list of values then you should use the first version with just a predicate that returns `Bool`