Higher order functions for ZSH