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