Add compose function

It's missing the docblock & tests but I wanted to get feedback before I submitted the left-to-right version