Nit picking here, but careful with `0 * 10 = 0` check, what if the composed function decided to skip the first element? It will be hard to tell if it did skip it or not. I'd modify this to -1 and check for -10.  Just a sanity check.