From 67e8e8a357e511ec76ed2acd7c3994520e9977a3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 23:55:38 +0000 Subject: [PATCH 1/2] Initial plan From ced93a885295984a0aa18f08583cca0bf563a227 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 23:57:16 +0000 Subject: [PATCH 2/2] docs: revert cross-field validation to and! with simple comparison and add note Co-authored-by: RJSonnenberg <24612120+RJSonnenberg@users.noreply.github.com> --- README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index af2f417..54028ce 100644 --- a/README.md +++ b/README.md @@ -953,13 +953,9 @@ module Example.Types qed } - let! _ = validation { - withValue (name, username) - disputeWithFact NameMatchesUsername (fun (n, u) -> - match n with - | Some nameVal -> Name.unwrap nameVal <> Username.unwrap u - | None -> true - ) + and! _ = validation { + withValue vm + disputeWithFact NameMatchesUsername (fun a -> a.Name <> a.Username) qed } @@ -967,8 +963,11 @@ module Example.Types } |> fromVCtx ``` -We need to include this in the `let!` chain but we can ignore the result. +We need to include this in the `and!` chain but we can ignore the result. Our complex type is validated. + +> **Note:** The example above compares the raw view model values before any validation occurs. If you need to perform cross-field checks on values that have already been individually validated (e.g., comparing two validated fields), see the [Cross-Field Validation](#cross-field-validation) section. + However, as far as complex types go, ours is fairly simple Let's try validating a type nested inside another type.