  We determine the M\"obius function of the poset of compositions of an
integer. In fact we give two proofs of this formula, one using an involution
and one involving discrete Morse theory. The composition poset turns out to be
intimately connected with subword order, whose M\"obius function was determined
by Bj\"orner. We show that using a generalization of subword order, we can
obtain both Bj\"orner's results and our own as special cases.
