Created
August 1, 2024 13:02
-
-
Save nrinaudo/5d76ad867e0f5c7039306185f8cd7cbe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test[LA, LB, RA, RB, F[_, _]]( | |
eqA: LA =:= RA, | |
eqB: LB =:= RB | |
): (F[LA, LB] =:= F[RA, RB]) = { | |
// We start from F[LA, LB] and prove equality of the "left" part. | |
val step1: F[LA, LB] =:= F[RA, LB] = eqA.liftCo[F[_, LB]] | |
// We start from F[RA, LB] and prove equality of the "right" part. | |
val step2: F[RA, LB] =:= F[RA, RB] = eqB.liftCo[F[RA, _]] | |
// Composing the two yields what we want. | |
step1.andThen(step2) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment