code: function filter(pred, m) {
    if(!isPredOrFunc(pred)) {
      throw new TypeError('filter: Pred or predicate function required for first argument')
    }
  
    const fn =
      x => predOrFunc(pred, x)
  
    if(m && isFunction(m.filter)) {
      return m.filter(fn)
    }
  
    if(m && isObject(m)) {
      return object.filter(fn, m)
    }
  
    throw new TypeError('filter: Filterable or Object required for second argument')
  }
docs: filter : Filterable f => (a -> Boolean) -> f a -> f a