Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
Select your favorite languages :
  • Or search :

Idiom #288 Check if set contains a value

Set the boolean b to true if the set x contains the element e, false otherwise.

import Data.Set (member)
b = e `member` x
var b = x.contains(e);
b = x(e)
_, b := x[e]
b := x[e]
let b = x.has(e);
b := e in x;
b = e in x
b = x.include? e
let b = x.contains(&e);

New implementation...