diff --git a/TestDynamo/Client/DtoMappers.fs b/TestDynamo/Client/DtoMappers.fs index b72526b..e4e4e76 100644 --- a/TestDynamo/Client/DtoMappers.fs +++ b/TestDynamo/Client/DtoMappers.fs @@ -137,7 +137,7 @@ module IsSet = tplDouble >> mapFst Expr.not >> mapSnd (flip Expr.assign (Expr.constant true)) - >> uncurry Expr.ifThen) + >> fun struct (``if``, ``then``) -> Expr.ifThen ``if`` ``then``) module VOption = @@ -480,14 +480,14 @@ module ToAttributeValue = struct ("M", typedefof<_ voption>.MakeGenericType([|typedefof>.MakeGenericType([|typeof; eFrom.Type|])|])) struct ("BOOL", typeof) ] - |> Seq.map (mapFst (fun name -> + |> Collection.mapFst (fun name -> [ eFrom.Type.GetProperty(name, BindingFlags.Instance ||| BindingFlags.Public) eFrom.Type.GetProperty(name, BindingFlags.Instance ||| BindingFlags.NonPublic) ] |> Seq.filter ((<>) null) |> Seq.filter _.CanRead |> Collection.tryHead - |> Maybe.expectSomeErr "Expected property on type %A" struct (name, eFrom.Type))) - |> Seq.map (uncurry (propAccessor invokePropMap)) + |> Maybe.expectSomeErr "Expected property on type %A" struct (name, eFrom.Type)) + |> Seq.map (fun struct (prop, typeExpectation) -> propAccessor invokePropMap prop typeExpectation) |> flip Seq.append [isNullAccessor eFrom.Type] |> createInstance builderT |> Expr.constant @@ -967,8 +967,8 @@ module ComplexObjectMapper = let private validatePropNames (t: Type) = let props = Array.append - <| t.GetProperties(BindingFlags.Instance ||| BindingFlags.Public) - <| t.GetProperties(BindingFlags.Instance ||| BindingFlags.NonPublic) + (t.GetProperties(BindingFlags.Instance ||| BindingFlags.Public)) + (t.GetProperties(BindingFlags.Instance ||| BindingFlags.NonPublic)) |> Seq.map _.Name |> Collection.groupBy _.ToLower() |> Collection.mapSnd List.ofSeq @@ -1087,8 +1087,7 @@ module ComplexObjectMapper = |> Either.map1Of2 (fun fromProp -> Expr.prop fromProp.Name eFrom |> tpl fromProp.Name) |> Either.map2Of2 (tpl "") |> Either.reduce - |> uncurry tryInvokePropMap - <| toParam.ParameterType + |> fun struct (propName, expr) -> tryInvokePropMap propName expr toParam.ParameterType ?|> ( fromProp |> Either.ignore2 diff --git a/TestDynamo/Client/Fetch.fs b/TestDynamo/Client/Fetch.fs index 974e326..bfa2e82 100644 --- a/TestDynamo/Client/Fetch.fs +++ b/TestDynamo/Client/Fetch.fs @@ -46,9 +46,10 @@ let private comparisonOperator = let private buildKeyCondition' struct (struct (attrAlias, valName), struct (attrName, value)) = let attrValues = attributeValueList value - |> Seq.mapi (curry <| function + |> Seq.mapi (function | struct (0, x) -> struct (valName, x) - | i, x -> struct ($"{valName}_{i}", x)) + | i, x -> struct ($"{valName}_{i}", x) + |> curry) |> List.ofSeq let exprString = diff --git a/TestDynamo/Client/Item.fs b/TestDynamo/Client/Item.fs index 8630406..8127261 100644 --- a/TestDynamo/Client/Item.fs +++ b/TestDynamo/Client/Item.fs @@ -151,7 +151,7 @@ module Update = struct ( Map.add x.name x.actualAttributeName names, x.value - ?|> (uncurry (flip3To1 Map.add values)) + ?|> fun struct (name, value) -> Map.add name value values ?|? values)) struct (Map.empty, Map.empty) |> tpl x.expression |> ValueSome diff --git a/TestDynamo/Client/MultiClientOperations.fs b/TestDynamo/Client/MultiClientOperations.fs index 46d21fa..9c217fb 100644 --- a/TestDynamo/Client/MultiClientOperations.fs +++ b/TestDynamo/Client/MultiClientOperations.fs @@ -64,9 +64,7 @@ module MultiClientOperations = let private execute operation database acc (struct (batchGetKey: Item.Batch.BatchItemKey, _) & inputs) = chooseDatabase batchGetKey.databaseId database - |> execute' operation - <| acc - <| inputs + |> fun db -> execute' operation db acc inputs let executeBatch operation initialState (database: Either) (batchRequests: struct (Item.Batch.BatchItemKey * _) seq) = batchRequests @@ -130,10 +128,10 @@ module MultiClientOperations = | k, v -> v.keys |> Seq.map (fun keys -> struct (k, { v with keys = [|keys|] }))) ResponseAggregator.executeBatch - <| (execute logger) - <| Settings.BatchItems.BatchGetItemMaxSizeBytes - <| database - <| requests + (execute logger) + Settings.BatchItems.BatchGetItemMaxSizeBytes + database + requests |> fun x -> { notProcessed = x.notProcessed @@ -190,10 +188,10 @@ module MultiClientOperations = |> MapUtils.toSeq ResponseAggregator.executeBatch - <| (execute logger) - <| Settings.BatchItems.BatchPutItemMaxSizeBytes - <| database - <| requests + (execute logger) + Settings.BatchItems.BatchPutItemMaxSizeBytes + database + requests |> _.notProcessed |> Map.map (fun _ -> List.collect id) |> fun x -> { notProcessed = x }: BatchWriteResponse diff --git a/TestDynamo/Client/Table.fs b/TestDynamo/Client/Table.fs index 4c6bc39..802dba2 100644 --- a/TestDynamo/Client/Table.fs +++ b/TestDynamo/Client/Table.fs @@ -58,9 +58,9 @@ module Local = KeySchema = toKeySchema x |> ValueSome Projection = buildProjection (Index.projections x) [Index.keyConfig x; Table.keyConfig t] |> ValueSome - IndexSizeBytes = Unchecked.defaultof<_> - OnDemandThroughput = Unchecked.defaultof<_> - ProvisionedThroughput = Unchecked.defaultof<_> }: GlobalSecondaryIndexDescription + IndexSizeBytes = ValueNone + OnDemandThroughput = ValueNone + ProvisionedThroughput = ValueNone }: GlobalSecondaryIndexDescription let private buildLsi awsAccountId databaseId t (x: Index) = @@ -70,12 +70,12 @@ module Local = KeySchema = toKeySchema x |> ValueSome Projection = buildProjection (Index.projections x) [Index.keyConfig x; Table.keyConfig t] |> ValueSome - IndexSizeBytes = Unchecked.defaultof<_> }: LocalSecondaryIndexDescription + IndexSizeBytes = ValueNone }: LocalSecondaryIndexDescription let private buildReplicaGsi (x: Index) = { IndexName = Index.getName x - OnDemandThroughputOverride = Unchecked.defaultof<_> - ProvisionedThroughputOverride = Unchecked.defaultof<_> }: ReplicaGlobalSecondaryIndexDescription + OnDemandThroughputOverride = ValueNone + ProvisionedThroughputOverride = ValueNone }: ReplicaGlobalSecondaryIndexDescription let private buildGsis awsAccountId databaseId t = Seq.filter Index.isGsi >> Seq.map (buildGsi awsAccountId databaseId t) @@ -108,14 +108,14 @@ module Local = { GlobalSecondaryIndexes = buildReplicaGsis replicaIndexes |> Array.ofSeq |> ValueSome RegionName = !! - OnDemandThroughputOverride = Unchecked.defaultof<_> - ProvisionedThroughputOverride = Unchecked.defaultof<_> - ReplicaStatusPercentProgress = Unchecked.defaultof<_> - ReplicaInaccessibleDateTime = Unchecked.defaultof<_> - ReplicaStatus = Unchecked.defaultof<_> - ReplicaStatusDescription = Unchecked.defaultof<_> - ReplicaTableClassSummary = Unchecked.defaultof<_> }: ReplicaDescription + KMSMasterKeyId = ValueNone + OnDemandThroughputOverride = ValueNone + ProvisionedThroughputOverride = ValueNone + ReplicaStatusPercentProgress = ValueNone + ReplicaInaccessibleDateTime = ValueNone + ReplicaStatus = ValueNone + ReplicaStatusDescription = ValueNone + ReplicaTableClassSummary = ValueNone }: ReplicaDescription let private toAttributeDefinitions attr = attr @@ -149,12 +149,11 @@ module Local = |> List.sortBy ( fstT >> fun x -> if x = databaseId then "" else x.regionId) - |> Seq.map ( - mapSnd ( - Table.indexes - >> _.Values - >> Seq.filter (Index.getName >> hasIndex))) - |> Seq.map (uncurry buildReplica) + |> Collection.mapSnd ( + Table.indexes + >> _.Values + >> Seq.filter (Index.getName >> hasIndex)) + |> Seq.map (fun struct (dbId, indexes) -> buildReplica dbId indexes) |> Array.ofSeq let tableDescription awsAccountId databaseId (cluster: Api.FSharp.GlobalDatabase voption) (table: TableDetails) status = @@ -179,14 +178,14 @@ module Local = // https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GlobalTables.html if replicas.Length > 0 then "2019.11.21" |> ValueSome else ValueNone - ArchivalSummary = Unchecked.defaultof<_> - BillingModeSummary = Unchecked.defaultof<_> - OnDemandThroughput = Unchecked.defaultof<_> - ProvisionedThroughput = Unchecked.defaultof<_> - RestoreSummary = Unchecked.defaultof<_> - SSEDescription = Unchecked.defaultof<_> - TableClassSummary = Unchecked.defaultof<_> - TableSizeBytes = Unchecked.defaultof<_> }: TableDescription + ArchivalSummary = ValueNone + BillingModeSummary = ValueNone + OnDemandThroughput = ValueNone + ProvisionedThroughput = ValueNone + RestoreSummary = ValueNone + SSEDescription = ValueNone + TableClassSummary = ValueNone + TableSizeBytes = ValueNone }: TableDescription let private fromKeySchema (xs: KeySchemaElement list) = let pk = xs |> Seq.filter (_.KeyType ??|> (_.Value >> (=) KeyType.HASH.Value) ??|? false) |> Collection.tryHead diff --git a/TestDynamo/Model/ChangeResults.fs b/TestDynamo/Model/ChangeResults.fs index c4cacf4..3bb9002 100644 --- a/TestDynamo/Model/ChangeResults.fs +++ b/TestDynamo/Model/ChangeResults.fs @@ -124,7 +124,7 @@ type DeleteAttemptData = with static member asDeleteRequest attemptedDelete = attemptedDelete.sortKey - ?|> (flip3To1 Map.add Map.empty |> uncurry) + ?|> fun struct (name, value) -> Map.add name value Map.empty |> ValueOption.defaultValue Map.empty |> Map.add (fstT attemptedDelete.partitionKey) (sndT attemptedDelete.partitionKey) |> tpl attemptedDelete.deleteId diff --git a/TestDynamo/Model/ClientError.fs b/TestDynamo/Model/ClientError.fs index 89d3b32..96f1e80 100644 --- a/TestDynamo/Model/ClientError.fs +++ b/TestDynamo/Model/ClientError.fs @@ -20,7 +20,7 @@ let private amazonDynamoDBException = |> Collection.tryHead |> Maybe.expectSomeErr "Could not find type Amazon.DynamoDBv2.AmazonDynamoDBException%s" "" -let private exn1 = +let private buildException = let ctr = amazonDynamoDBException.GetConstructor([|typeof|]) Expr.lambda1 typeof (Seq.singleton >> Expr.newObj ctr >> Expr.convert typeof) @@ -28,7 +28,7 @@ let private exn1 = |> Converters.fromFunc :?> string -> Exception -let private exn2 = +let private buildException2 = let ctr = amazonDynamoDBException.GetConstructor([|typeof; typeof|]) let inputT = typeof @@ -44,8 +44,8 @@ let unit' = box () let testDynamoException' msg inner data = let exn = match inner with - | ValueNone -> exn1 msg - | ValueSome e -> exn2 struct (msg, e) + | ValueNone -> buildException msg + | ValueSome e -> buildException2 struct (msg, e) exn.Data.Add(clientErrFlag', unit') diff --git a/TestDynamo/Model/Compiler.AstOps.fs b/TestDynamo/Model/Compiler.AstOps.fs index c29a179..3769a02 100644 --- a/TestDynamo/Model/Compiler.AstOps.fs +++ b/TestDynamo/Model/Compiler.AstOps.fs @@ -30,8 +30,9 @@ module Value = let private accessorErr3 = NonEmptyList.singleton "Invalid expression, expected form: x.y or x[123]" |> Error let accessorExpression: CodeGenSettings -> (AstNode -> CompilerOutput) -> ExpressionPartCompiler = - let rec expandAccessorPath acc = Collection.foldBack (folder |> curry) (Ok acc) - and folder = function + let rec expandAccessorPath acc = Collection.foldBack folder (Ok acc) + and folder s x = + match struct (s, x) with | struct (Error _ & e, _) -> e | Ok acc, AstNode.Accessor x -> x::acc |> Ok | Ok acc, AstNode.Synthetic (AccessorPath x) -> x@acc |> Ok diff --git a/TestDynamo/Model/Compiler.QueryExpressionCompiler.fs b/TestDynamo/Model/Compiler.QueryExpressionCompiler.fs index 701f5ed..565a336 100644 --- a/TestDynamo/Model/Compiler.QueryExpressionCompiler.fs +++ b/TestDynamo/Model/Compiler.QueryExpressionCompiler.fs @@ -132,11 +132,11 @@ module QueryExpressionCompiler = let substringAttr = getSubstring query.expressionParams.expressionAttrValues Partition.subset - <| ValueSome substringAttr - <| ValueNone - <| true - <| true - <| partition + (ValueSome substringAttr) + ValueNone + true + true + partition |> Seq.takeWhile (fun x -> let str = itemValue x startsWith struct (str, substringAttr)) @@ -248,7 +248,7 @@ module QueryExpressionCompiler = >> ValueOption.defaultValue Seq.empty queryKeys.partitionKey - |> ValueOption.defaultWith (fun _ -> ClientError.clientError "Query does not contain partition key condition") + ?|>? fun _ -> ClientError.clientError "Query does not contain partition key condition" <| inputs <| index |> function diff --git a/TestDynamo/Model/Database.fs b/TestDynamo/Model/Database.fs index 0fc1acf..d2ac32a 100644 --- a/TestDynamo/Model/Database.fs +++ b/TestDynamo/Model/Database.fs @@ -395,7 +395,7 @@ module Database = >> Maybe.defaultWith (fun name -> ClientError.clientError $"Invalid index {name}") req.indexName >> Logger.logFn1 "Using index %A" logger) |> mapSnd Table.attributeNames - |> uncurry (executeFetch req logger)) + |> fun struct (index, tableKeys) -> executeFetch req logger index tableKeys) let private concatStreamErrors err1 err2 = Io.retn Collection.concat2 diff --git a/TestDynamo/Model/ExpressionExecutors.fs b/TestDynamo/Model/ExpressionExecutors.fs index d0e8157..267e0d3 100644 --- a/TestDynamo/Model/ExpressionExecutors.fs +++ b/TestDynamo/Model/ExpressionExecutors.fs @@ -163,7 +163,7 @@ module Fetch = Map.empty |> Map.add (Index.partitionKeyName index) (Index.partitionKey item index) - |> flip (ValueOption.fold (flip <| fun struct (k, v) -> Map.add k v)) sk + |> flip (ValueOption.fold (fun map struct (k, v) -> Map.add k v map)) sk module private Validation = diff --git a/TestDynamo/Model/Index.fs b/TestDynamo/Model/Index.fs index 6347900..08df1ad 100644 --- a/TestDynamo/Model/Index.fs +++ b/TestDynamo/Model/Index.fs @@ -459,9 +459,10 @@ module Index = [] let inline private noResultToValidate struct (_, x) _ = struct ([], x) let private validateOptionalResultPrecedence loggerIndex result = + mapSnd ValueSome result |> uncurry Maybe.tpl - ?|> (validateResultPrecedence loggerIndex) + ?|> validateResultPrecedence loggerIndex |> ValueOption.defaultWith (noResultToValidate result) let put = diff --git a/TestDynamo/Model/Item.fs b/TestDynamo/Model/Item.fs index 1a389eb..416fe97 100644 --- a/TestDynamo/Model/Item.fs +++ b/TestDynamo/Model/Item.fs @@ -105,10 +105,8 @@ type AttributeSet = Seq.map (function | String x -> x | x -> ClientError.clientError $"Set item {x} is not {AttributeType.String}") xs - static member contains = - function - | struct (value, As struct (_, set)) -> Set.contains value set - |> curry + + static member contains value (As struct (_, set)) = Set.contains value set /// Returns none if union types do not match static member private trySetOperation op = function @@ -324,11 +322,6 @@ and /// member this.AttributeType = this |> AttributeValue.getType |> toString - // member this.IsNull = - // match this with - // | Null -> true - // | _ -> false - member this.TryString([] value: byref) = match this with | String x -> @@ -688,8 +681,8 @@ module ItemSize = else truncated |> double - // hack, add a tiny number so that (log10 9 = 1, log10 10 = 2) - |> (+) 0.00000001 + // hack, add a tiny number (10^-10) so that (log10 9 = 1, log10 10 = 2) + |> (+) 0.0000000001 |> Math.Log10 |> Math.Ceiling |> int @@ -811,8 +804,8 @@ module Item = match struct (Map.containsKey null item || Map.containsKey "" item, prop) with | false, _ -> invalidNested | true, name -> Collection.prepend $"Item has map or property attribute with null or empty name: \"{prop |> List.rev |> Str.join dot}\"" invalidNested - | (depth, prop), HashSet xs -> AttributeSet.asSet xs |> Seq.collect (curry getAttrErrors (depth + 1, "[]"::prop)) - | (depth, prop), AttributeList xs -> xs |> AttributeListType.asSeq |> Seq.collect (curry getAttrErrors (depth + 1, "[]"::prop)) + | (depth, prop), HashSet xs -> AttributeSet.asSet xs |> Seq.collect (fun attr -> getAttrErrors ((depth + 1, "[]"::prop), attr)) + | (depth, prop), AttributeList xs -> AttributeListType.asSeq xs |> Seq.collect (fun attr -> getAttrErrors ((depth + 1, "[]"::prop), attr)) | _, Null -> Seq.empty | _, String _ -> Seq.empty | _, Number _ -> Seq.empty diff --git a/TestDynamo/Model/KeyConfig.fs b/TestDynamo/Model/KeyConfig.fs index 6fa1d9f..ee651d0 100644 --- a/TestDynamo/Model/KeyConfig.fs +++ b/TestDynamo/Model/KeyConfig.fs @@ -136,13 +136,14 @@ module KeyConfig = let asAttributeMap pk sk keyConfig = let pk = partitionKeyName keyConfig |> flip tpl pk - let sk = sortKeyName keyConfig |> flip tpl sk |> uncurry Maybe.tpl + let sk = sortKeyName keyConfig |> flip Maybe.tpl sk let map = uncurry Map.add pk Map.empty |> ( - ValueOption.map (uncurry Map.add) sk - |> ValueOption.defaultValue id) + sk + ?|> uncurry Map.add + ?|? id) partitionKey map keyConfig |> ignoreTyped sortKey map keyConfig |> ignoreTyped diff --git a/TestDynamo/Model/Partition.fs b/TestDynamo/Model/Partition.fs index 6bb8a0c..5db426c 100644 --- a/TestDynamo/Model/Partition.fs +++ b/TestDynamo/Model/Partition.fs @@ -191,15 +191,14 @@ module Partition = |> WithoutSortKey |> tpl (ChangeResult.ofPut item' ValueNone) - let get = - function + let get key partition = + match struct (key, partition) with | struct (ValueNone, WithSortKey _) -> ClientError.clientError "Sort key required" | ValueSome _, WithoutSortKey _ -> ClientError.clientError "Sort key not required" | struct (ValueSome (sortKey: AttributeValue), WithSortKey struct (_, partition)) -> AvlTree.tryFind sortKey partition.data ?|> PartitionBlock.toSeq |> ValueOption.defaultValue Seq.empty | struct (ValueNone, WithoutSortKey partition) -> partition.data |> PartitionBlock.toSeq - |> curry let put = let itemsKeySelection = PartitionData.i3Of3 getRequiredSortKey @@ -216,14 +215,12 @@ module Partition = |> flip AvlTree.tryFind data.data ?|> ( PartitionBlock.put data.info.sortKeysUnique item) - |> ValueOption.defaultWith (fun _ -> - PartitionBlock.create item - |> tpl ValueNone) + ?|>? (fun _ -> struct (ValueNone, PartitionBlock.create item)) + |> mapFst (ChangeResult.ofPut item) |> mapSnd ( addOrReplace data >> sndT >> PartitionData.addData data) - |> mapFst (ChangeResult.ofPut item) let putWithoutSortKey data item = let item = asItem data.info.name data.info.projections data.info.keys item @@ -260,11 +257,13 @@ module Partition = let itemKeySelection = PartitionData.i1Of3 getRequiredSortKey let removeFromPartitionItems struct (deleteId, item) = + let buildChangeResult = + deleteId + ?|>? IncrementingId.next + |> ChangeResult.ofDelete + PartitionBlock.removeByInternalId (Item.internalId item) - >> mapFst ( - ValueOption.map ( - tpl (ValueOption.defaultWith IncrementingId.next deleteId) - >> uncurry ChangeResult.ofDelete)) + >> mapFst (ValueOption.map buildChangeResult) let inline nothingToRemove items _ = struct (ValueNone, items) let removeFromTree' items item key = diff --git a/TestDynamo/Model/Stream.fs b/TestDynamo/Model/Stream.fs index c5ddadd..156589f 100644 --- a/TestDynamo/Model/Stream.fs +++ b/TestDynamo/Model/Stream.fs @@ -239,8 +239,7 @@ module private StreamSubscriber = let result = flip subscriber c |> addErrorLogging logger subscriberId - |> errHandling - <| message + |> fun f -> errHandling f message if result.IsCompleted then result else diff --git a/TestDynamo/Model/Table.fs b/TestDynamo/Model/Table.fs index f4b57ef..f3038a9 100644 --- a/TestDynamo/Model/Table.fs +++ b/TestDynamo/Model/Table.fs @@ -192,16 +192,16 @@ module Table = >> Maybe.expectSomeErr "Cannot find key attribute %A" pk let buildKeyConfig allAttributes pk sk = - KeyConfig.create - <| buildKeyAttr pk allAttributes - <| ValueOption.map (flip buildKeyAttr allAttributes) sk - - fun name local (config: CreateIndexData) tableKeyCols allAttributes -> + sk + ?|> flip buildKeyAttr allAttributes + |> KeyConfig.create (buildKeyAttr pk allAttributes) + + fun name local (config: CreateIndexData) struct (tablePk, tableSk) allAttributes -> let struct (pk, sk) = config.keys let buildKeyConfig = buildKeyConfig allAttributes { keyConfig = buildKeyConfig pk sk - tableKeyConfig = uncurry buildKeyConfig tableKeyCols + tableKeyConfig = buildKeyConfig tablePk tableSk config = config tableName = fstT name indexName = sndT name @@ -259,11 +259,11 @@ module Table = let primaryIndex = buildIndex - <| struct (name, ValueNone) - <| false - <| indexData - <| data.primaryIndex - <| data.attributes + struct (name, ValueNone) + false + indexData + data.primaryIndex + data.attributes let table = { info = diff --git a/TestDynamo/Utils.fs b/TestDynamo/Utils.fs index 4925088..b0f4dae 100644 --- a/TestDynamo/Utils.fs +++ b/TestDynamo/Utils.fs @@ -73,14 +73,10 @@ let inline curryRef f x y = f (x, y) [] let inline curry3 f x y z = f struct (x, y, z) [] -let inline curry4 f w x y z = f struct (w, x, y, z) -[] let inline uncurry f struct (x, y) = f x y [] let inline uncurry3 f struct (x, y, z) = f x y z [] -let inline uncurry4 f struct (w, x, y, z) = f w x y z -[] let inline tplDouble x = struct (x, x) [] let inline tpl x y = struct (x, y) diff --git a/tests/TestDynamo.Tests/Requests.Items.fs b/tests/TestDynamo.Tests/Requests.Items.fs index e2ca7a6..2f39c52 100644 --- a/tests/TestDynamo.Tests/Requests.Items.fs +++ b/tests/TestDynamo.Tests/Requests.Items.fs @@ -33,8 +33,8 @@ type ItemBuilder = static member withCondition condition x = { x with condition = ValueSome condition } : ItemBuilder static member tableName x = x.tName |> ValueOption.defaultWith (fun _ -> invalidOp "missing table name") - static member buildAttribute = - function + static member buildAttribute label value = + match struct (label, value) with | struct ("S", value) -> let attrV = DynamoAttributeValue() attrV.S <- value @@ -112,7 +112,6 @@ type ItemBuilder = maybeSetProperty "IsMSet" attrV true attrV | x -> invalidOp $"unknown {x}" - |> curry static member withAttrs attrs x = let attrs = Seq.fold (fun s (x: KeyValuePair) -> Map.add x.Key x.Value s) x.attrs attrs