Skip to content

Allow validation result type to be different from subject type #44

Description

@Unisay

I have the following problem with the current design:

It assumes that type of dirty un-validatied input ~~ the type of clean validated output:
validation turns Subject into a Valid Subject.

This doesn't play well with custom types that make invalid state non-representable, e.g. Email
I want to turn String into Email (not to Valid String)

Which actually makes it a parsing, not validation.

"Parse, don't validate!" is well explained here:
https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions