Comments (4)
Here is how they do it for numeric types
from iron.
It is possible to create in a lib Gen
instances for each IronType manually (e.g Gen[Int :| Greater[V]]
) but note you can barely fully "automatize" their creation. For example, you can't create (AFAIK. My knowledge about Scalacheck is limited) a Gen[A :| B]
that works for all inner type A
with constraint any B
. The lib would need to contain atleast an instance of Gen
by constraint.
That's not a big issue however. Since Scalacheck is a big and widely used project, a new module iron-scalacheck
sounds legit to me.
Since I currently lack of time, any help/initiative is welcomed.
from iron.
I think you're right, and that approach would work great. Not sure how it would work with composed constraints, but maybe we could be inspired by refined-scalacheck
from iron.
It should be simple to make a gen for constraint unions but I don't know how to make a generic Gen for constraint intersections right now.
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 HOT 2
- 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.