I’m looking for a solution for testing if a value of any type is empty (or default). I.e. some kind of method on Any that tests if a String instance is equal to "", an Int – to 0, a Float – to 0f, a Boolean – to false, a List contains no items and so on for other types. Primarilly I’m interested whether some solution already exists in the standard library and if not how you would implement it. I believe this could be useful and if it doesn’t exist in the standard library it should be suggested.
I’m looking for a solution for testing if a value of any type is
Share
Use
Zerotype-class from Scalaz.Link to a blog post of mine on a related topic.