This is a continuation of the discussion in Converters between A => Option[B], PartialFunction and extractor objects.
As discussed there, I think it would be a good idea to have a library called
extras in the Scala Platform that hosts small and useful utilities that improve the Scala developer experience. The one that @yangbo proposes fits in this definition – converters from functions and partial functions to extractors. This helps the reusability of already defined functions and saves some lines of code. Another candidate would be
An idea would be to add all these small utilities in one repository and create a network of maintainers that care about them. As these utilities are supposed to be small in size, sources and documentations would be shared and defined in sbt subprojects. There would be a
extras sbt subproject that will depend on all the other subprojects and would be published in the Scala Platform as an empty artifact. Each utility would also be published so that users have a fine-grained control over what they pull in in their projects.
Why should we do such thing? Small libraries are difficult to find. They are hosted in different GitHub profiles and finding them is painful. Often, they are unpublished because they are so small that the library authors don’t see any value in publishing them and writing some docs or buzzwords to enhance searchability – they just write it for them and it’s understandable that they don’t want to spend too much time on them. If we have such a package, we would solve all these problems and lay the ground for new small utils that may show up in the future. People interested in these utilities could add them to
extras and help maintain them.
I would like to discuss the value of this idea with the Community and hopefully identify potential microlibraries that would be the perfect fit for this
extras package. They could be from a DIY util that you use daily in your organization to any random library that you’ve written because the standard library didn’t provide
This package would be similar to Twitter Util. We should also define how it differs from it and probe potential ways of collaborating with the Twitter guys.