title: Map and filter an object using Ramda
body: <p>I'm learning <a href="http://ramdajs.com/docs/"><code>Ramda</code></a> and I'm a little confused how to build this <code>lodash</code> chain below using <code>Ramda</code>. <code>Ramda</code> returns functions for it's operations instead of actual values, and this seems to be the focal point of functional programming, however in this example I have a second parameter <code>localRegex</code> that isn't a primary argument. It seems that it wouldn't be possible to get this to be completely duplicated without wrapping the <code>Ramda</code> function and using <code>.apply()</code> or <code>.call()</code> to propagate the wrapped function arguments to the <code>Ramda</code> function, which seems more complicated then using <code>lodash</code>.</p>
  
  <pre><code>var _ = require("lodash")
  var R = require("ramda")
  
  var localRegex = /^.\.\/|^.\/|^\//
  
  function getRecursiveDeps(deps, localRegex){
    return _.chain(deps)
      .map(function(dep){
        return dep.source.value
      })
      .filter(function(dep){
        return dep.match(localRegex)
      })
      .value()
  }
  
  var items = [
    {
      "source": {
        "value": "./foo"
      }
    },
    {
      "source": {
        "value": "bar"
      }
    }
  ]
  
  console.log(getRecursiveDeps(items, localRegex))
  </code></pre>
  
  <p>Here's what I've got and its not working.</p>
  
  <pre><code>var getRecursiveDeps = R.chain(
    R.map(function(dependency){
      return dependency.source.value
    }),
    R.filter(function(value){
      return value.match(localRegex)
    })
  )
  </code></pre>
  
  <p>Is there a way to have <code>Ramda</code> use a main variable for chaining and also pass down <code>localRegex</code>? Is there a way to duplicate the <code>getRecursiveDeps</code> that uses <code>lodash</code> in <code>Ramda</code>?</p>
  
  <p>There's a lot of talk about how <code>Ramda</code> is functional and <code>underscore</code> and <code>lodash</code> aren't. But in this case the <code>getRecursiveDeps</code> is a function that returns a value from <code>lodash</code>. When you create functions like this from <code>lodash</code> or <code>underscore</code> the result is the same, there's just more work when it comes to wrapping it, in this case what would be the perk using <code>Ramda</code> over <code>Lodash</code>?</p>