refined
Ammonite-Ops
Our great sponsors
- Onboard AI - Learn any GitHub repo in 59 seconds
- InfluxDB - Collect and Analyze Billions of Data Points in Real Time
- SaaSHub - Software Alternatives and Reviews
refined | Ammonite-Ops | |
---|---|---|
15 | 15 | |
1,657 | 2,575 | |
- | 0.1% | |
8.8 | 7.4 | |
16 days ago | 7 days ago | |
Scala | Scala | |
MIT License | MIT License |
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
-
Does the fthomas/refined library work differently in Scala 3?
Does the Refined library for Scala (at https://github.com/fthomas/refined; "eu.timepit" %% "refined") work in Scala 3? Does it work differently?
-
Design by contract - Preconditions and Postconditions - I'm really amazed with Scala.
Scala likes to do design-by-contract on the type level. You encode your pre- and post- conditions into types. Libraries like iron (scala 3) https://github.com/Iltotore/iron and refined (scala 2) https://github.com/fthomas/refined allow you to do all that without throwing any exceptions and they can even enforce some simple predicates at compile time.
-
Restrict uses of annotation in Scala
Annotation is not the only way (and probably not the best IMHO) to do refined types. You might be interested in Iron in Scala 3 or Refined in Scala 2/3.
-
Can types replace validation?
In one respect, nothing. You’re right. Even given refinement types as in Haskell or Scala, there is indeed a necessarily-partial function (refineV in Scala) to refine a value to its refinement type.
-
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?
-
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:
Ammonite-Ops
-
Scala Isn't Fun Anymore
That's funny, because this is what I really like about Scala; how quick and easy it is to get a project started.
> sbt new scala/scala3.g8
will just create an empty project. If you don't even want to bother with a project, use use scala-cli or ammonite (http://ammonite.io/) to just start banging out code.
Even the upgrading of a project from Scala2 to Scala3 is a breeze, thanks to very good backwards compatibility of new library releases.
- A Python-compatible statically typed language erg-lang/erg
-
Scala 3 Reflection
Scripting API is quite limited, so the third option. - reuse the ammonite scripts https://github.com/com-lihaoyi/Ammonite or look how this is implemented (using internal compiler API),
-
Audacity Fork Without Any Sentry Telemetry or Crash Reporting
Here's an example of a smaller project that added telemetry without suffering a fork:
-
Scripting with Java – Improving Approachability
Or ammonite - I've ran Gatling performance test from a simple script based on this gist it fetches all the dependencies, compiles and runs the test, producing nice html report..
-
25 years of OCaml
Scala with the Typelevel ecosystem. Stay on the jVM, but have a much more pleasant and robust experience, including a great REPL.
-
The Scala ecosystem and circular dependencies?
If you are installing, and you are learning, I would also recommend ammonite as an easier REPL.
-
IPython as a System Shell
I've been using amm on and off https://ammonite.io/#Ammonite-Shell
pretty nice if you know scala, still have to use regular shell(s) so I do not forget them
-
A Lisp REPL as my main shell
I've never tested Ammonite, only read the https://ammonite.io/#Ammonite-Shell, so I'm only guessing here.
From what I understand, Ammonite was designed as a "readline shell" as I wrote in the article. It perpetuates this approach that everything is a command.
The thesis of my article suggests we do the opposite: I'm suggesting to rethink shells by starting from the interface (here the SLY REPL) and then implement the shell features.
In particular, it seems that Ammonite does not support back-references and I'm not sure it has an interactive inspector.
While Ammonite seems to be a definite improvement over the _syntax_ of Bash, etc., I'm not sure it brings much novelty in terms of user interface. But again, I know very little about it so I may have missed some features :)
I wonder what people think about Ammonite (https://ammonite.io/)?
It's not Lisp but Scala so may not be the authors language of choice however it can be used as a Shell: https://ammonite.io/#Ammonite-Shell
I am personally using it and compared to a classical shell like Bash it's really nice for more structured data related tasks (exploring some API, checking some data, creating a bunch of PRs at once, ...).
It also makes use of Scala's adjustable syntax and functional concepts so you basically get shell piping but in a strongly typed fashion (e.g.
What are some alternatives?
better-files - Simple, safe and intuitive Scala I/O
Shapeless - Generic programming for Scala
Scalaz - Principled Functional Programming in Scala
calculator - Windows Calculator: A simple yet powerful calculator that ships with Windows
Records for Scala - Labeled records for Scala based on structural refinement types and macros.
cats - Lightweight, modular, and extensible library for functional programming.
Scala-Logging - Convenient and performant logging library for Scala wrapping SLF4J.
ScalaTest - A testing tool for Scala and Java developers
scala.meta - Library to read, analyze, transform and generate Scala programs
Cassovary - Cassovary is a simple big graph processing library for the JVM
Simulacrum - First class syntax support for type classes in Scala