❔ Is there a built-in way to map (transform) a tuple?
For example, I'd like to do this (hypothetical code):
instead of that
The reasoning is that it's cumbersome to have to introduce variable names for intermediate computations involving tuples. Being able to transform them directly makes it possible to avoid that.
7 Replies
If I'm understanding correctly, there is no built-in way to do it, but you could have a general-purpose
Map
extension. Thinker
REPL Result: Success
Result: bool
Compile: 690.131ms | Execution: 118.999ms | React with ❌ to remove this embed.
I assume what you're looking for is more like F#'s built-in
|>
operatorI don't know F#, so I can't really comment on that. By "built-in" I merely meant "something part of the standard library".
Yeah no, there isn't
it seems like your solution works just fine though (although it's not built-in)
thanks!
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.