The documentation on the attribute OneIdentity says
OneIdentityis an attribute that can be assigned to a symbol
fto indicate that
f[f[x]], etc. are all equivalent to
xfor the purpose of pattern matching.
Then why does the input
SetAttributes[f,OneIdentity] MatchQ[x, f[_]]
False? On the other hand (from the examples in the documentation), the following input returns
SetAttributes[f, OneIdentity] MatchQ[a, f[x_: 0, y_]]
Is there a problem with the documentation or am I misunderstanding it?