Compiling basic patterns