From 896f4db64e3671d53a6d669552f3f404e2720bbc Mon Sep 17 00:00:00 2001 From: Chet Husk Date: Tue, 29 Dec 2020 10:59:59 -0600 Subject: [PATCH] document CE constructors iin a way that circumvents the warnings (#137) --- Flips/Domain.fs | 20 ++++++++++---------- Flips/UnitsOfMeasure.Domain.fs | 12 +++++++----- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Flips/Domain.fs b/Flips/Domain.fs index 01cac26..6724b27 100644 --- a/Flips/Domain.fs +++ b/Flips/Domain.fs @@ -278,12 +278,12 @@ module Builders = |> String.concat "_" |> (sprintf "%s_%s" prefix) - // note: the param for this constructor argument is correct, to the best of my knowledge, but the validation logic inside the compiler doesn't recognize it - /// A Computation Expression for creating constraints with a predefined naming convention - /// The string which will be the prefix for all of the constraints - /// A sequence of Constraints whith the given prefix and a unique name for each constraint - type ConstraintBuilder (constraintSetPrefix:string) = + type ConstraintBuilder + /// A Computation Expression for creating constraints with a predefined naming convention + /// The string which will be the prefix for all of the constraints + /// A sequence of Constraints whith the given prefix and a unique name for each constraint + (constraintSetPrefix:string) = member this.Yield (cExpr:ConstraintExpression) = cExpr @@ -298,12 +298,12 @@ module Builders = member this.Run(source:seq<'a * ConstraintExpression>) = source |> Seq.map (fun (n, c) -> Constraint.create (namer constraintSetPrefix n) c) - // note: the param for this constructor argument is correct, to the best of my knowledge, but the validation logic inside the compiler doesn't recognize it - /// A Computation Expression for creating tuples of type ('Key * Decision) - /// The prefix used for naming the Decisions - /// A seq of type ('Key * Decision). The result is typically used to create a Map or SliceMap - type DecisionBuilder (decisionSetPrefix:string) = + type DecisionBuilder + /// A Computation Expression for creating tuples of type ('Key * Decision) + /// The prefix used for naming the Decisions + /// A seq of type ('Key * Decision). The result is typically used to create a Map or SliceMap + (decisionSetPrefix:string) = let createDecision indices decisionType = let name = namer decisionSetPrefix indices diff --git a/Flips/UnitsOfMeasure.Domain.fs b/Flips/UnitsOfMeasure.Domain.fs index 34201e2..af4e8d0 100644 --- a/Flips/UnitsOfMeasure.Domain.fs +++ b/Flips/UnitsOfMeasure.Domain.fs @@ -127,13 +127,15 @@ module Solution = [] module Builders = - // Note: this warning is because the compiler's detection for parameters is off for constructors. This is ok until that logic is fixed. - /// A Computation Expression for creating tuples of type ( * Decision<>) + /// A Computation Expression for creating tuples of type ( * Decision<>) /// The Unit of Measure for the Decisions - /// The prefix used for naming the Decisions - /// A seq of type ( * Decision<>). The result is typically used to create a Map or SliceMap - type DecisionBuilder<[] 'Measure> (decisionSetPrefix:string) = + type DecisionBuilder<[] 'Measure> + /// A Computation Expression for creating tuples of type ( * Decision<>) + /// The Unit of Measure for the Decisions + /// The prefix used for naming the Decisions + /// A seq of type ( * Decision<>). The result is typically used to create a Map or SliceMap + (decisionSetPrefix:string) = let createDecision indices decisionType = let name = namer decisionSetPrefix indices