Uh... those actually totally exist, and back when pistols were one shot weapons were actually fairly popular, primarily in ship to ship boarding actions where most of the fighting was close combat.
Here's some classic examples of the type:
Here's a more modern incarnation:
The entire point of a bayonet on a full size musket was to turn it into a baby pole arm once things got up close and personal. Ye olde rifles with bayonets, and even the much shorter M1 Garand rifle as recently as WW2 have proven surprisingly effective against men armed with swords, as did polearms before them in the hands of a competent individual. There's something to be said for weight and reach.
Fun fact, the last bayonet charge in recorded military history was October 2011 in Afghanistan courtesy of The Princess of Wales's Regiment of the British Army.