extract curry() into its own module