So pattern matching in function arguments does not behave as one might expect:
i: Head[True] o: Symbol i: Head[False] o: Symbol i: testBool = True i: Head[testBool] o: Symbol
Also, because of the defined argument default, this does work:
i: fNoMatchToBool[arg_Boolean:True] := "Will not actually match True or False"; i: fNoMatchToBool[testBool] (* Not seen, does not match, will just bounce *) o: fNoMatchToBool[True]
But you can HACK a match by using an argument value set test:
I: fNoMatchToBool o: Will not actually match True or False
i: fHackMatchBool[arg:True|False] := "Will match True or False"'; i: fFakeMatchBool[testBool] o: "Will match True or False"
Note, however, that if use this trick you can't then specify a Boolean default for the argument.
The most MMA-keen of MMA fans might claim that's not a hack, but certainly the lack of "Boolean" argument matching is a "gotcha". Note that BooleanQ gives True on either True or False, making it slightly more surprising that there isn't comparable argument pattern matching.
I: BooleanQ[testBool] o: True