Availability:built-in
[semidet]memberchk(?Elem,
+List)True when Elem is an element of List. This‘chk’variant
of
member/2
is semi deterministic and typically used to test membership of a list.
Raises a type error if scanning List encounters
a non-list. Note that memberchk/2
does not perform a full list typecheck. For example, memberchk(a,
[a|b]) succeeds without error. If List is cyclic and Elem
is not a member of
List, memberchk/2
eventually raises a type error.139Eventually
here means it will scan as many elements as the longest list that may
exist given the current stack usage before raising the exception.