μscala
μscala is a set of general purpose micro libraries written in Scala.
What can I find in here?
In this project you'll find a set of general purpose micro libraries written
in scala.
List is as follows:
- headed: an ultra simple "list" that ensures the existence
of at least an element (i.e. a non-empty list). - i18n: message internationalization scala micro library
with no dependencies for the JVM. - resources: helps dealing with resources in the classpath, allowing
null-safe access and listing resources from packages. - result: a right biased union type that holds a value
for a successful computation or a value for a failed one. - result-async: a right biased union type that holds a value
for an asynchronous/future successful computation or a value for a failed one. - result-specs2: specs2 matchers for the result type
- retry: small utility that retries a computation until it is
successful using a backoff algorithm (exponential backoff by default). - timeout: class that allows to query if a specific amount
of time has elapsed or not. - try-ops: small library that adds some useful methods to
Try
likesequence. - typed-env: allows to retrieve environment variables safely
and with types. - url: immutable URL class with some useful methods to construct
it, get the params, convert it to other types...
Why?
Sometimes the Scala/Java ecosystem forces you to include huge libraries
when you only want to get a small piece of functionality. It's not strange
to find projects that include Cats, Scalaz, Guava or Apache Commons (or all
of them!) just because they want to use a simple piece of functionality from
each of those projects.
The idea behind μscala is to create a set of very small libraries that offer
some of the most common used functionality that is missing from the standard
Scala & Java standard libraries.
It's important to note that μscala is not and will never be a replacement
for any of the above libraries. They are excellent libraries that I use
in lots of projects.
What defines a μ-library?
In order to be included in μscala, a library must fulfill the following
requisites:
- Shall be composed by a single functionality (oversimplifying, 1 single file)
- Shall not have any external dependency, except for:
- Test libraries
- A maximum of 2 μ-libraries
- Shall cover a very common functionality
- Shall be well tested
- Shall be MIT licensed unless for licensing compatibility issues a
different open source license is needed.
Can I contribute?
Yes, of course, any contribution is welcome. You can contribute either by:
- Adding a new μ-library
- Adding some function to an existing one
Just fork the repo and raise a PR.