memp


memp(p, xs)
      

Return the first tail of the list xs for whose head the predicate p return true. If no such element, return false.

The predicate should accept one argument and return a single value. It should not modify xs.Examples:


memp(is_odd, [1, 2, 3, 4, 5])
// [1, 2, 3, 4, 5]

memp(is_even, [1, 2, 3, 4, 5])
// [2, 3, 4, 5]
      

Also see:

find
member
position


Core Module Index | Contents