question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auto Tupling when partial function is expected

See original GitHub issue

This currently compiles:

class Test {
  def foo(f: PartialFunction[(Int, Int), Int]) = ???
  foo((a, b) => 1)
}

I don’t think we should apply auto-tupling in this case though.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
olafurpgcommented, Dec 20, 2017

I personally think this behavior is intuitive. A total function is a partial function that happens to cover all inputs. I wish Function was a subtype of PartialFunction instead of the other way around, it’s one of the biggest warts in the standard library in my opinion.

0reactions
oderskycommented, Jan 27, 2018

I am not sure anymore what the right way is. Anyway, I don’t think we should act on this until we have sorted out PartialFunctions. And once we did that, the answer to the question of auto-tupling or not is probably “whatever fits best”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Tuples in map, flatmap,... partial functions - Stack Overflow
For an apply, you get "auto-tupling": ... But you don't get auto-untupling. ... First, the type syntax of parameter function for the map...
Read more >
SIP: Auto-tupling of n-ary functions. · Issue #897 · lampepfl/dotty
Auto -tupling composes with eta-expansion. That is an n-ary function generated by eta-expansion can in turn be adapted to the expected type ...
Read more >
Let's drop auto-tupling - Language Design - Scala Contributors
It seems to be that most people who have given some thought about this issue are coming down to drop this feature, instead...
Read more >
Tupling Calculation Eliminates Multiple Data ... - CiteSeerX
Abstract. Tupling is a well-known transformation tactic to obtain new e cient recursive functions by grouping some recursive func- tions into a tuple....
Read more >
Tupling calculation eliminates multiple ... - ACM Digital Library
Tupling is a well-known transformation tactic to obtain new efficient recursive functions by grouping some recursive func- tions into a tuple.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found