I have a list of values:
[0,7,4,5,3,1,4,5,5,1,7,0,7,7,0]
and would like to return any values that are not in the range of [1..8]
[1..8]
Use filter to keep elements that satisfies a condition.
filter
Prelude> filter (`notElem` theBigListOfValues) [1..8] [2,6,8]
Or just take the complement using the (\\) operator.
(\\)
Prelude> import Data.List Prelude Data.List> [1..8] \\ theBigListOfValues [2,6,8]