Try specifying a type expression.
xs = [if x < 3 then "bang" else "boom" | x <- xs]
So, xsthis is a list, we still do not know what type of elements it has, so let's look at the following. List items
if x < 3 then "bang" else "boom"
which is an expression of type String(aka [Char]).
So xs :: [String]. x , , xs, String
if x < 3
3 ,
3 :: Num a => a
, x < 3
- a
Num , String , x String s.
, Num String, .
, Num String ( ?), .
xs - ,
boom xs = [if x < 3 then "bang" else "boom" | x <- xs]
, x String, .