Skip to content

Refined typesΒ #1072

@EstebanMarin

Description

@EstebanMarin

Hello
I was thinking that it would be great to add to some type refinement.

Something link this

case class Person(name: String, age: Int :| Positive)

object Person:
  given Schema[Person] = Schema.derived

val jsonCodec = Schema[Person].derive(JsonFormat)

I was playing around with the concept, and chose Iron as its scala3 macro based, and hoped πŸ™ it worked but maybe I was pushing too far.

I was wondering how hard can it be to implement and what should be a good starting point. Or is it better to desist from the idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions