Skip to content

reduce applied to a list of functions #643

@neuwirthe

Description

@neuwirthe

reduce does not work in the following example.
Should reduce applied to a lust of functions work this way?

compose <- function(f,g){
  function(x)f(g(x))
}
compose(sin,sqrt)(2)
reduce(list(sin,sqrt),compose,.dir="backward")(2)
reduce(list(sin,sqrt),compose,.dir="forward")(2)
reduce(list(sin,sqrt),compose,.dir="forward") %>% class()
reduce(list(sin,sqrt),compose,.dir="backward") %>% class()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorreduce 🔨

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions