refined
Refinement types for Scala (by fthomas)
Scalaz
Principled Functional Programming in Scala (by scalaz)
Our great sponsors
refined | Scalaz | |
---|---|---|
9 | 1 | |
1,517 | 4,548 | |
- | 0.2% | |
8.3 | 9.0 | |
7 days ago | 8 days ago | |
Scala | Scala | |
MIT License | GNU General Public License v3.0 or later |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
refined
Posts with mentions or reviews of refined.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-02-26.
-
Help me break the fourth wall
Perhaps refined would help you? It lets you set constraints (i.e. "rules") for values / types. You get compile-time enforcement for constants and fallible methods for runtime values (i.e. Either[Error, RefinedValue]).
-
Simple, Naïve, and Wrong: More than you wanted to know about Scala Case Classes
This is more or less how derivation works when you want to use something like Refined types (it exposes Validate[Type, Refinement] typeclass if I remember correctly). Enumeratum exposes Enum[A], and newtypes expose Coercible[From, To].
-
Opinions on implementing traits for validation with the help of a companion object
You will probably be interested into Iron or Refined.
-
Help with Single Value Validated Types
You want either a refined type, a newtype, or if you are in Scala 3 an opaque type.
- Alan Kay's answer to What was the last breakthrough in computer programming?
-
Types versus sets in math and programming languages
Refined Scala
-
Option[] as type of field in case class
Additionally, I also like to use Refined, so that my names are actually NonEmptyStrings, and I'll usually go even farther and make a LastName type alias to NonEmptyString and a FirstName type alias to NonEmptyString so that I can legitimately return just Char as an initial, for example. That way parsing guarantees you're not just sending me empty stuff that is just as useless as an empty person, and also so that I don't accidentally put a FirstName where a LastName should go somewhere in my code.
-
Using refined to improve type safety and error reporting in Scala
I wrote a short piece on my company's blog explaining how we used refined to validate incoming data and parse it into more… well, refined types: https://engineering.contentsquare.com/2021/scala-refined-types/
-
Why there is still no ExpressJS-like alternative in Scala?
This example uses probably the most popular JSON library for Scala, Circe. There is another Scala library that lets us "be more specific with," or "refine," our types, called Refined. http4s doesn't provide any particular support for Refined, but Circe has a module integrating Refined, meaning that all of Circe's parsing, encoding, and decoding support is integrated with Refined. Putting together http4s' Circe support, Circe's generic codec derivation, and Circe's Refined integration, here's what I came up with:
Scalaz
Posts with mentions or reviews of Scalaz.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-01-24.
-
In Search of the Best Functional Programming Back-End: 2021 Update
I’ve specifically had 2 job offers internally at my company because of this language. First with Cats and Scalaz and now with ZIO, Scala has taken the best parts of Haskell, the best parts of Scala, and made it really nice to work with. You can barely see the OOP leftovers.
What are some alternatives?
When comparing refined and Scalaz you can also consider the following projects:
cats - Lightweight, modular, and extensible library for functional programming.
Shapeless - Generic programming for Scala
Ammonite-Ops - Scala Scripting
ScalaTest - A testing tool for Scala and Java developers
Monocle - Optics library for Scala
Chimney - Scala library for boilerplate-free, type-safe data transformations
better-files - Simple, safe and intuitive Scala I/O
scribe - The fastest logging library in the world. Built from scratch in Scala and programmatically configurable.
Scala-Logging - Convenient and performant logging library for Scala wrapping SLF4J.
scala.meta - Library to read, analyze, transform and generate Scala programs