The singletonSet function returns a function that returns true when past the same integer that was used to create the function and false otherwise. So the contains function should work as expected. You pass the function returned from singletonSet into contains, so contains never calls singletonSet.
asset(contains(singletonSet(5), 5) == true)
asset(contains(singletonSet(5), 2) == false)
I hope this makes sense and helps a little,
Iain.