7mind/no-more-orphans
Companion repository for 'No More Orphans'
{ "createdAt": "2019-04-25T12:46:44Z", "defaultBranch": "develop", "description": "Companion repository for 'No More Orphans'", "fullName": "7mind/no-more-orphans", "homepage": "https://blog.7mind.io/no-more-orphans.html", "language": "Scala", "name": "no-more-orphans", "pushedAt": "2022-10-13T19:40:44Z", "stargazersCount": 14, "topics": [ "blog", "implicits", "orphans", "scala", "typeclasses" ], "updatedAt": "2023-04-28T13:40:53Z", "url": "https://github.com/7mind/no-more-orphans"}No More Orphans
Section titled “No More Orphans”This is a sample project that defines a couple optional typeclass instances using No More Orphans trick. More details are in the accompanying blog post.
Use SBT to run the test suite:
git clone https://github.com/7mind/no-more-orphans.gitcd no-more-orphanssbt testTested on Scala 2.12.12, 2.13.3, 2.11.12 (2.11 only works partially) and dotty
Addendum: the pattern may not work for non-higher-kinded types on Scala 2 (i.e. plain types like Int, not type constructors like List[_] or typeclasses like Monad[_[_]]).