Guide for implementing a custom refined type (ITT: Some cool FiniteDuration refining cheats)
See original GitHub issueI love this library, thanks for your work on it
I wanted a way to say a FiniteDuration must be > 5 seconds
earlier today and set about looking into writing my own refined type, but it looks tricky - is this really simple, have I missed something?
A guide on extending the library with your own types might be nice (which is why i made this ticket)
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Safe, Expressive Code with Refinement Types - OVO Tech Blog
In this blog post I will explore refinement types and their implementation in Scala's refined library. Refinement types are a powerful tool ...
Read more >Refined types, what are they good for? - Beyond the lines
Type refinement is all about making the types more precise. But why would do that? Because using the correct types makes your program...
Read more >fthomas/refined: Refinement types for Scala - GitHub
refined -scopt allows to read command line options with refined types using scopt; refined-shapeless. External modules. Below is an incomplete list of third- ......
Read more >How we used Refined to improve type safety and error ...
Today, we are going to talk about a way to refine our types to make them more expressive and increase confidence in our...
Read more >Build your own refinement types in Scala 3 - Michał Sitko blog
I wondered what it would take to implement a simple refinement types library. ... new version can offer some improvements in the process....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve done some shameless thievery from the
size
validate instance you linked, and i haven’t yet tested this but:You could define a companion object for
MySpecialType
:MySpecialType.from
is then the same function asrefineV[LengthInSeconds[Greater[W.`5`.T]]](_: FiniteDuration)
.