Comments (1)
The building of this feature is in progress.
Implicit conversions being magic and a bit uncontrolable (notably when several are in conflict), a typeclass-based solution is investigated.
The investigated approach is a Consequence
(the name isn't fixed yet) typeclass which is analogous to Constraint
but with the type of the constrained value passed.
As an example:
inline def verified[A, B1, B2]: Consequence[A, B1, B2] = new Consequence {
override inline def assert(value: A): Boolean = true
}
inline given [A, B]: Consequence[A, And[B, ?], B] = Consequence.verified //B && ? => B
inline given [A, C]: Consequence[A, And[?, C], C] = Consequence.verified //? && C => C
Concerning the relationship with Constraint
, to preserve retrocompatibility, the two entities are disjunct. The default instance of Consequence
will use its Constraint
alter ego if exists.
from iron.
Related Issues (20)
- Support first order types HOT 5
- Rename `.refine` into `.refineUnsafe` HOT 2
- Is Show[A] really needed to summon Meta[A :| C] instances for the doobie support HOT 2
- Use fewerBraces in Iron codebase HOT 2
- Create an instance of Int :| Positive from 0 without exceptions. HOT 6
- Add NonEmptyString type HOT 2
- Support iron types for avro4s schema HOT 2
- Spark/Gallia/... support?
- Better diagnostics for compile-time errors
- Change color of error message HOT 2
- deprecation warning does not show for `refine` HOT 3
- Better String support at compile-time HOT 1
- Use skunk 1.0.0-M.x instead of 0.6.x HOT 3
- Generating Avro4s.Schema fails HOT 1
- Warnings issued when publishing (locally) a dependent project
- Question: exporting an alias for use in dependent projects, to use with constructor syntax without needing an `iron` import HOT 2
- Make RefinedTypeOps definition more ergonomic
- Make RefinedTypeOps blackbox
- Add talks/articles links to website
- Subtype relationship for union of constraints: implication needed? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iron.