Natural languages are compositional in that the meaning of complex expressions depends on those of the parts and how they are put together. Here, I ask the following question: why are languages compositional? I answer this question by extending Lewis-Skyrms signaling games with a rudimentary form of compositional signaling and exploring simple reinforcement learning therein. As it turns out: in complex worlds, having compositional signaling helps simple agents learn to communicate. I am also able to show that learning the meaning of a function word, once meanings of atomic words are known, presents no difficulty.