Fleece


Operators Module

Namespace: Fleece

Assembly: Fleece.NewtonsoftJson.dll

Parent Module: Newtonsoft

Functions and values

Function or value Description

key .= value

Full Usage: key .= value

Parameters:
    key : string
    value : ^a

Returns: string * JsonValue

Creates a new Json key-value pair for a Json object

key : string
value : ^a
Returns: string * JsonValue

key .=? value

Full Usage: key .=? value

Parameters:
    key : string
    value : ^a option

Returns: string * JToken

Creates a new Json key-value pair for a Json object if the value is present in the option

key : string
value : ^a option
Returns: string * JToken

o .@ key

Full Usage: o .@ key

Parameters:
Returns: Result<^a, DecodeError>

Gets a value from a Json object

o : IReadOnlyDictionary<string, JsonValue>
key : string
Returns: Result<^a, DecodeError>

o .@? key

Full Usage: o .@? key

Parameters:
Returns: Result<^a option, DecodeError>

Tries to get a value from a Json object. Returns None if key is not present in the object.

o : IReadOnlyDictionary<string, JsonValue>
key : string
Returns: Result<^a option, DecodeError>

f (fieldName, getter)

Full Usage: f (fieldName, getter)

Parameters:
    f : ^Value -> 'a - An object initializer as a curried function.
    fieldName : string - A string that will be used as key to the field.
    getter : 'T -> ^Value - The field getter function.

Returns: (IReadOnlyDictionary<string, JsonValue> -> Result<'a, DecodeError>) * ('T -> IReadOnlyDictionary<string, JsonValue>) The resulting object codec.

Appends the first field mapping to the codec.

f : ^Value -> 'a

An object initializer as a curried function.

fieldName : string

A string that will be used as key to the field.

getter : 'T -> ^Value

The field getter function.

Returns: (IReadOnlyDictionary<string, JsonValue> -> Result<'a, DecodeError>) * ('T -> IReadOnlyDictionary<string, JsonValue>)

The resulting object codec.

f (fieldName, getter)

Full Usage: f (fieldName, getter)

Parameters:
    f : ^Value option -> 'a - An object initializer as a curried function.
    fieldName : string - A string that will be used as key to the field.
    getter : 'T -> ^Value option - The field getter function.

Returns: (IReadOnlyDictionary<string, JsonValue> -> Result<'a, DecodeError>) * ('T -> IReadOnlyDictionary<string, JsonValue>) The resulting object codec.

Appends the first field (optional) mapping to the codec.

f : ^Value option -> 'a

An object initializer as a curried function.

fieldName : string

A string that will be used as key to the field.

getter : 'T -> ^Value option

The field getter function.

Returns: (IReadOnlyDictionary<string, JsonValue> -> Result<'a, DecodeError>) * ('T -> IReadOnlyDictionary<string, JsonValue>)

The resulting object codec.

(arg1, arg2) <*/> (fieldName, getter)

Full Usage: (arg1, arg2) <*/> (fieldName, getter)

Parameters:
Returns: (IReadOnlyDictionary<string, JsonValue> -> Result<'Rest, DecodeError>) * ('T -> IReadOnlyDictionary<string, JsonValue>) The resulting object codec.

Applies a field mapping to the object codec.

arg0 : Decoder<IReadOnlyDictionary<string, JsonValue>, (^Value -> 'Rest)>
arg1 : Encoder<IReadOnlyDictionary<string, JsonValue>, 'T>
fieldName : string

A string that will be used as key to the field.

getter : 'T -> ^Value

The field getter function.

Returns: (IReadOnlyDictionary<string, JsonValue> -> Result<'Rest, DecodeError>) * ('T -> IReadOnlyDictionary<string, JsonValue>)

The resulting object codec.

(arg1, arg2) <*/?> (fieldName, getter)

Full Usage: (arg1, arg2) <*/?> (fieldName, getter)

Parameters:
Returns: (IReadOnlyDictionary<string, JsonValue> -> Result<'Rest, DecodeError>) * ('T -> IReadOnlyDictionary<string, JsonValue>) The resulting object codec.

Appends an optional field mapping to the codec.

arg0 : Decoder<IReadOnlyDictionary<string, JsonValue>, (^Value option -> 'Rest)>
arg1 : Encoder<IReadOnlyDictionary<string, JsonValue>, 'T>
fieldName : string

A string that will be used as key to the field.

getter : 'T -> ^Value option

The field getter function.

Returns: (IReadOnlyDictionary<string, JsonValue> -> Result<'Rest, DecodeError>) * ('T -> IReadOnlyDictionary<string, JsonValue>)

The resulting object codec.

a ^= b

Full Usage: a ^= b

Parameters:
    a : 'a
    b : 'b

Returns: 'a * 'b

Tuple two values.

a : 'a
b : 'b
Returns: 'a * 'b

jchoice codecs

Full Usage: jchoice codecs

Parameters:
Returns: ConcreteCodec<^S, ^S, 't1, 't2>

codecs : seq<ConcreteCodec<^S, ^S, 't1, 't2>>
Returns: ConcreteCodec<^S, ^S, 't1, 't2>

jgetFromListOptWith decoder o key

Full Usage: jgetFromListOptWith decoder o key

Parameters:
Returns: Result<'b option, 'c>

Tries to get a value from a Json object. Returns None if key is not present in the object.

decoder : JsonValue -> ^a
o : KeyValuePair<string, JsonValue> list
key : string
Returns: Result<'b option, 'c>

jgetFromListWith decoder o key

Full Usage: jgetFromListWith decoder o key

Parameters:
Returns: Result<'a, DecodeError>

Gets a value from a Json object

decoder : JsonValue -> Result<'a, DecodeError>
o : KeyValuePair<string, JsonValue> list
key : string
Returns: Result<'a, DecodeError>

jopt prop getter

Full Usage: jopt prop getter

Parameters:
    prop : string
    getter : 'a -> ^b option

Returns: ConcreteCodec<KeyValuePair<string, JsonValue> list, KeyValuePair<string, JsonValue> list, ^b option, 'a>

Derives a concrete field codec for an optional field

prop : string
getter : 'a -> ^b option
Returns: ConcreteCodec<KeyValuePair<string, JsonValue> list, KeyValuePair<string, JsonValue> list, ^b option, 'a>

joptWith (arg1, arg2) prop getter

Full Usage: joptWith (arg1, arg2) prop getter

Parameters:
    arg0 : JsonValue -> ^a
    arg1 : 'Value -> 'd
    prop : string
    getter : 'e -> 'Value option

Returns: ConcreteCodec<KeyValuePair<string, JsonValue> list, KeyValuePair<string, 'd> list, 'b option, 'e>

arg0 : JsonValue -> ^a
arg1 : 'Value -> 'd
prop : string
getter : 'e -> 'Value option
Returns: ConcreteCodec<KeyValuePair<string, JsonValue> list, KeyValuePair<string, 'd> list, 'b option, 'e>

jreq name getter

Full Usage: jreq name getter

Parameters:
    name : string
    getter : 'T -> ^param option

Returns: ConcreteCodec<KeyValuePair<string, JsonValue> list, KeyValuePair<string, JsonValue> list, ^param, 'T>

Derives a concrete field codec for a required field

name : string
getter : 'T -> ^param option
Returns: ConcreteCodec<KeyValuePair<string, JsonValue> list, KeyValuePair<string, JsonValue> list, ^param, 'T>

jreqWith (arg1, arg2) prop getter

Full Usage: jreqWith (arg1, arg2) prop getter

Parameters:
Returns: ConcreteCodec<KeyValuePair<string, JsonValue> list, KeyValuePair<string, 'b> list, 'a, 'T>

arg0 : JsonValue -> Result<'a, DecodeError>
arg1 : 'Value -> 'b
prop : string
getter : 'T -> 'Value option
Returns: ConcreteCodec<KeyValuePair<string, JsonValue> list, KeyValuePair<string, 'b> list, 'a, 'T>