GithubHelp home page GithubHelp logo

Scalacheck support about iron HOT 4 CLOSED

iltotore avatar iltotore commented on September 18, 2024
Scalacheck support

from iron.

Comments (4)

hejfelix avatar hejfelix commented on September 18, 2024 1

https://github.com/fthomas/refined/blob/master/modules/scalacheck/shared/src/main/scala/eu/timepit/refined/scalacheck/numeric.scala

Here is how they do it for numeric types

from iron.

Iltotore avatar Iltotore commented on September 18, 2024

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.

hejfelix avatar hejfelix commented on September 18, 2024

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.

Iltotore avatar Iltotore commented on September 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.