Skip to content

Why are tuples right biased? #4094

Answered by johnynek
jgogstad asked this question in Q&A
Dec 22, 2021 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

There are two questions here:

  1. should there be a default Functor, Foldable, FlatMap, etc... for tuples?
  2. if so, which element should be the preferred element?

I think there is an argument that the instances are too confusing and should not be in default scope. I am somewhat sympathetic to the idea that perhaps these should require an import.

On to the second question: if you are going to have an instance in scope, why is it the right most? The answer there, I believe has to do with scala's type inference with higher kinded types. I think eventually a right to left inference algorithm for higher kinded types, was fixed (I believe became default in 2.12 or 2.13). See this old bug for more i…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@jgogstad
Comment options

Comment options

You must be logged in to vote
3 replies
@jgogstad
Comment options

@djspiewak
Comment options

@jgogstad
Comment options

Answer selected by jgogstad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants