Composing with patterns