R/monoid.R

monoid <- function(op) {
  mappend <- function(f, g) {
    h <- function(x, ret) {
      r <- op(f(x, ret), g(x, ret))
      return(r)
    }
    return(h)
  }
  return(mappend)
}

Try the kriens package in your browser

Any scripts or data that you put into this service are public.

kriens documentation built on May 1, 2019, 10:50 p.m.