How can I get this to work as per the comment?

```
let obj = {
standard: 'car',
nice: {
friend : 'bob'
}
}
let safeInc = R.unless(R.path(['nice', 'friend']), R.pluck('standard'));
safeInc(obj);
// should return bob instead of object
```

I want something like

`pathOr`

but instead of a default value, it uses another path. How can this be implemented?
Is there a recognized combinator for

`f => x => f(x, x)`

?
@bgits Can you use

`R.either`

@ram-bot

```
let obj = {
standard: 'car',
nice: {
friend : 'bob'
}
}
let safeInc = R.either(R.path(['nice', 'friend']), R.prop('standard'));
safeInc(obj);
```

`'bob'`

so, working with pairs is kind annoying

eg. i have a function that makes sure that a list of percentages add up to 100% after being rounded, but the values are stored in an object

so I have to do

`R.toPairs`

... lots of computations .. `R.fromPairs`

```
return R.compose(
R.fromPairs,
R.adjust(([k, v]) => [k, offBy + v], 0),
R.map(([k, v]) => [k, Math.round(v)]),
R.sortBy(([k, v]) => Math.round(v) - v),
R.toPairs
)(percentages);
```

which yields a pretty ugly pipeline with

`[k, v]`

in everything
it kind of bums me out too ha..

See below for a horrible idea

See below for a horrible idea

```
const objCompose = (...args) => R.compose(R.fromPairs, ...args, R.toPairs)
const usingKey = (...args) => R.compose(...args, x => x[0])
const usingVal = (...args) => R.compose(...args, x => x[1])
return objCompose(
R.adjust(([k, v]) => [k, offBy + v], 0),
R.map(([k, v]) => [k, Math.round(v)]),
usingVal(R.sortBy(v => Math.round(v) - v)),
)(percentages);
```

Lenses (well, isomorphisms) can be a pretty good solution to dealing with that issue

Also,

`R.map`

works directly on objects
@ram-bot

```
const pairIso = R.lens(toPairs, fromPairs);
const valLens = R.lensIndex(1);
over(pairIso)(map(over(valLens, inc)))({a: 1, b: 2})
```

`{ a: 2, b: 3 }`

@ram-bot

`map(inc)({a: 1, b: 2});`

`{ a: 2, b: 3 }`

It might also be interesting to create functions

`withKey`

, `withVal`

, and `withPair`

that could abstract the array unpacking process...
yeah, i thought about doing that but wasn't sure how that would play with

`R.sortBy`

and `R.adjust`