support for curried functions; functional version of logreg