-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify graph tests by implicitly converting tuples to edges
- Loading branch information
Abhijit Sarkar
committed
Jan 16, 2025
1 parent
3f9311c
commit 977ea25
Showing
5 changed files
with
59 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package graph | ||
|
||
object Util: | ||
given [A, B] => Conversion[Tuple, Edge[A, B]] = | ||
case (u, v) => Edge(u.asInstanceOf[A], v.asInstanceOf[A], None) | ||
case (u, v, d) => Edge(u.asInstanceOf[A], v.asInstanceOf[A], Some(d.asInstanceOf[B])) | ||
case _ => throw IllegalArgumentException(s"unsupported tuple") |