Skip to content

Add first steps of Validation implementation - #10

Closed
glours wants to merge 6 commits into
mainfrom
validation-type
Closed

glours wants to merge 6 commits into
mainfrom
validation-type

Conversation

@glours

@glours glours commented Jun 1, 2021 •

Copy link
Copy Markdown
Owner

Implementation of Validation control type.

Func of Validation type:

  • IsValid
  • IsInvalid() bool
  • OrElse
  • ErrorOrElse
  • Swap
  • ToEither
  • Filter

High order functions

  • ValidOf
  • InvalidOf
  • FromTry
  • FromEither
  • CombineValidation
  • ApplyValidation
  • MapValidation
  • FlatMapValidation
  • MapErrorValidation
  • FoldValidation
  • BimapValidation

Other:

  • Add samples to README.md

Fix #2

Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
@glours glours self-assigned this Jun 1, 2021
glours added 4 commits June 1, 2021 23:17
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
@glours
glours force-pushed the validation-type branch from 41e9d24 to ac68691 Compare June 2, 2021 21:14
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
@glours

glours commented Oct 2, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #27. This draft predates Go 1.18 (.go2 files), uses the interface + Valid/Invalid pattern the library dropped in #15, and held a single error, so it could not accumulate. #27 reimplements Validation as a concrete type with generic methods and accumulates every error. The validation-type branch is kept for reference.

@glours glours closed this Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Validation type in control package

1 participant