From 15ea1bc4de00fae185a6a92eba97ce2f590f694d Mon Sep 17 00:00:00 2001 From: Kevin Schneider Date: Thu, 26 Sep 2024 11:11:24 +0200 Subject: [PATCH] fix #39 --- src/DynamicObj/DynObj.fs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/DynamicObj/DynObj.fs b/src/DynamicObj/DynObj.fs index 08207d7..8ddafef 100644 --- a/src/DynamicObj/DynObj.fs +++ b/src/DynamicObj/DynObj.fs @@ -50,7 +50,7 @@ module DynObj = /// /// /// This function mutates the first input DynamicObj - let rec combine (first:DynamicObj) (second:DynamicObj) = + let rec combine (first:#DynamicObj) (second:#DynamicObj) = //printfn "Type %A" (first.GetType()) /// Consider deep-copy of first for kv in (second.GetProperties true) do @@ -95,7 +95,7 @@ module DynObj = /// The value of the property to set /// The DynamicObj to set the property on /// This function mutates the input DynamicObj - let withProperty (propertyName:string) (propertyValue:'TPropertyValue) (dynObj: DynamicObj) = + let inline withProperty (propertyName:string) (propertyValue:'TPropertyValue) (dynObj: #DynamicObj) = setProperty propertyName propertyValue dynObj dynObj @@ -120,7 +120,7 @@ module DynObj = /// The value of the property to set /// The DynamicObj to set the property on /// This function mutates the input DynamicObj - let withOptionalProperty (propertyName: string) (propertyValue: 'TPropertyValue option) (dynObj: DynamicObj) = + let inline withOptionalProperty (propertyName: string) (propertyValue: 'TPropertyValue option) (dynObj: #DynamicObj) = match propertyValue with | Some pv -> dynObj |> withProperty propertyName pv | None -> dynObj @@ -148,7 +148,7 @@ module DynObj = /// A function to apply to the property value before setting it on the DynamicObj /// The DynamicObj to set the property on /// This function mutates the input DynamicObj - let withOptionalPropertyBy (propertyName: string) (propertyValue: 'TPropertyValue option) (mapping: 'TPropertyValue -> 'UPropertyValue) (dynObj: DynamicObj) = + let inline withOptionalPropertyBy (propertyName: string) (propertyValue: 'TPropertyValue option) (mapping: 'TPropertyValue -> 'UPropertyValue) (dynObj: #DynamicObj) = match propertyValue with | Some pv -> dynObj |> withProperty propertyName (mapping pv) | None -> dynObj @@ -182,7 +182,7 @@ module DynObj = /// The DynamicObj to remove the property from /// This function mutates the input DynamicObj /// Thrown if the dynamic property does not exist - let withoutProperty(propertyName: string) (dynObj: DynamicObj) = + let inline withoutProperty(propertyName: string) (dynObj: #DynamicObj) = dynObj |> removeProperty propertyName dynObj