@gabejohnson @Bradcomp i would want *something* to fill that role though; transducers are all we have that is "lazy-ish"

i wouldn't object to removing them from core if there was a way to plug them in when desired

@buzzdecafe pulling the

`_x*`

functions out into a separate lib makes sense.
Is it possible to have the type sorting, based on the lookupTable below? I think I need to use R.useWith?

```
const lookupTable = {
Type1: 1,
Type2: 3,
Type3: 2,
};
R.sortWith([
R.descend(R.prop('type')),
R.ascend(R.prop('title')),
])(items)
```

how to use ramda do this

```
[{ctime:1}].map(item => {
item.useTime = 1000 - item.ctime
return item
})
```

@qiufeihai This should do the trick (REPL):

```
R.map(item => {
item.useTime = 1000 - item.ctime
return item
}, [{ctime:1}] )
```

Or did you want to refactor the internal function, as well?

If so, this should do the trick (REPL):

```
R.map( R.converge( R.assoc( 'useTime' )
, [ R.o( R.subtract( 1000 ) )
( R.prop( 'ctime' ) )
, R.identity
]
)
)
( [ { ctime:1 } ] )
```

Is there a short way to flip non-first two arguments of function in ramada?

In other words, to make this:

In other words, to make this:

`(a -> c -> b -> d) -> a -> b -> c -> d`

@barbiturat How about this? I think it will work as long as you know you'll always pass

`a`

in on its own, first:```
fn = a => b => c => d => doStuff
fn2 = R.o( R.flip, fn )
```

But what if i want to flip third and fourth arguments?

I’m looking for an universal solution

Just curious @barbiturat, what is the use case?

I’m just learning ramda. Trying to create simple solution for a method like “flip args”

For example:

For example:

```
// flipArgs(firstIdx, secondIdx, fn)
const fn = curry((a, b, c, d) => a + b + c + d);
flipArgs(2, 3, fn)('a', 'b', 'c', 'd') //-> ‘abdc’
```

I come from an OO, imperitive background…sometimes when I’m trying to figure something like this out, I’ll write something imperative first. Then I can better visualize the pieces and start to break it down into declarative bits. The more experience I get the less I need to go down that route… I think it is just a matter of brain training ;)

Or you can just list out the steps to start, I’d think something like this:

- Take all of the arguments
- Pull out the indexed arguments
- Reconstruct the list, inserting the indexed arguments in their new position
- Apply that new list to the provided function

Here's what I'm missing in Ramda:

```
// Allusion to Clojure Threading Macros
// (https://clojure.org/guides/threading_macros)
function thread(o) {
return (...fns) => R.pipe(...fns)(o);
}
```

Is there a way to convert

Also are there wiki/faq’s for learning how to read type signatures, etc ?

`dot chaining`

functions into a compose style syntax?Also are there wiki/faq’s for learning how to read type signatures, etc ?

I’ve come across

`invoker`

, but unsure if that’s the best way to move forward
hi @jdkschang . here is an intro to type signatures: https://github.com/ramda/ramda/wiki/Type-Signatures

awesome!

also found out how to convert object methods into composable functions here: https://egghead.io/lessons/javascript-convert-object-methods-into-composable-functions-with-ramda

cool

thanks @Andrew Van Slaars if he’s in here

ya,

`invoker`

is good for that
thanks @kedashoe for the

`type signatures`

link, it’s exactly what I was looking for!
np :)

@miwillhite Eventually I made this:

```
const argsToArray = unapply(identity);
const takeArgs = curryN(2, compose(
apply(take),
splitAt(1),
argsToArray
));
const sliceByCount = converge(slice, [identity, add, nthArg(2)])
const reverseElems = converge(insertAll, [
identity,
compose(reverse, sliceByCount),
remove
]);
const reverseArgs = converge(compose, [
compose(apply, nthArg(2)),
compose(apply(reverseElems), takeArgs(2)),
always(argsToArray)
])
const fn = (a, b, c, d, e) => a + b + c + d + e;
const reversed = reverseArgs(1, 3, fn);
reversed('a', 'b', 'c', 'd', 'e') //-> “adcbe"
```

hi, encountered some strange behavior with ifElse and compose and wondering if anyone knew why. the code below will return a function; however when replaced with a R.cond, will return the correct answer (REPL)

```
const sortedData = [
{ field: 1},
{ field: 2},
{ field: 3},
]
const matcher = R.compose(R.filter(R.__, sortedData), R.whereEq);
R.ifElse(
R.isNil,
R.always(null),
matcher
)({field: 2});
```