Header menu logo Nu

Lens<'a, 's> Type

Provides access to the property of a simulant. Initially inspired by Haskell lenses, but highly specialized for simulant properties.

Record fields

Record Field Description

Get

Full Usage: Get

Field type: World -> 'a
Field type: World -> 'a

Name

Full Usage: Name

Field type: string
Field type: string

SetOpt

Full Usage: SetOpt

Field type: ('a -> World -> unit) voption
Field type: ('a -> World -> unit) voption

This

Full Usage: This

Field type: 's
Field type: 's

Instance members

Instance member Description

this.ChangeEvent

Full Usage: this.ChangeEvent

Returns: ChangeData Address

The change event associated with the lensed property.

Returns: ChangeData Address

this.GetBy

Full Usage: this.GetBy

Parameters:
    by : 'a -> 'a0
    world : World

Returns: 'a0

Get the lensed value mapped by the `by` function.

by : 'a -> 'a0
world : World
Returns: 'a0

this.GetByPlus

Full Usage: this.GetByPlus

Parameters:
Returns: 'a0

Get the lensed value mapped by the `by` function that includes the world value in its input.

by : 'a -> World -> 'a0
world : World
Returns: 'a0

this.Map

Full Usage: this.Map

Parameters:
    mapper : 'a -> 'a
    world : World

Update the lensed property's value using the given mapper function. Throws an exception if the lens is readonly.

mapper : 'a -> 'a
world : World

this.MapPlus

Full Usage: this.MapPlus

Parameters:

Update the lensed property's value using the given mapper function that also receives the world as input. Throws an exception if the lens is readonly.

mapper : 'a -> World -> 'a
world : World

this.Set

Full Usage: this.Set

Parameters:
    value : 'a
    world : World

Set the lensed property to the given value. Throws an exception if the lens is readonly.

value : 'a
world : World

this.TryMap

Full Usage: this.TryMap

Parameters:
    mapper : 'a -> 'a
    world : World

Returns: bool

Attempt to transform the lensed property's value using the given mapper function.

mapper : 'a -> 'a
world : World
Returns: bool

this.TryMapPlus

Full Usage: this.TryMapPlus

Parameters:
Returns: bool

Attempt to transform the lensed property's value using the given mapper function that also receives the world as input.

mapper : 'a -> World -> 'a
world : World
Returns: bool

this.TrySet

Full Usage: this.TrySet

Parameters:
    value : 'a
    world : World

Returns: bool

Attempt to set the property in the world to the given value.

value : 'a
world : World
Returns: bool

this.Type

Full Usage: this.Type

Returns: Type
Modifiers: inline

The type of the lensed property.

Returns: Type

Static members

Static member Description

lens *= value

Full Usage: lens *= value

Parameters:
    lens : Lens<^a, 'c>
    value : ^b

Returns: World -> unit
Modifiers: inline
Type parameters: 'c

Multiplies the lensed property's value. Throws an exception if the lens is readonly.

lens : Lens<^a, 'c>
value : ^b
Returns: World -> unit

!+lens

Full Usage: !+lens

Parameters:
    lens : Lens<^a, 'c>

Returns: World -> unit
Modifiers: inline
Type parameters: 'c

Increments the lensed property's value. Throws an exception if the lens is readonly.

lens : Lens<^a, 'c>
Returns: World -> unit

!-lens

Full Usage: !-lens

Parameters:
    lens : Lens<^a, 'c>

Returns: World -> unit
Modifiers: inline
Type parameters: 'c

Decrements the lensed property's value. Throws an exception if the lens is readonly.

lens : Lens<^a, 'c>
Returns: World -> unit

!.lens

Full Usage: !.lens

Parameters:
    lens : Lens<'a, 'b>

Returns: World -> 'a
Modifiers: inline

Get a lensed property's value.

lens : Lens<'a, 'b>
Returns: World -> 'a

lens %= value

Full Usage: lens %= value

Parameters:
    lens : Lens<^a, 'c>
    value : ^b

Returns: World -> unit
Modifiers: inline
Type parameters: 'c

Computes the modulus of the lensed property's value. Throws an exception if the lens is readonly.

lens : Lens<^a, 'c>
value : ^b
Returns: World -> unit

lens += value

Full Usage: lens += value

Parameters:
    lens : Lens<^a, 'c>
    value : ^b

Returns: World -> unit
Modifiers: inline
Type parameters: 'c

Adds the specified value to the lensed property's value. Throws an exception if the lens is readonly.

lens : Lens<^a, 'c>
value : ^b
Returns: World -> unit

lens -= value

Full Usage: lens -= value

Parameters:
    lens : Lens<^a, 'c>
    value : ^b

Returns: World -> unit
Modifiers: inline
Type parameters: 'c

Subtracts the specified value from the lensed property's value. Throws an exception if the lens is readonly.

lens : Lens<^a, 'c>
value : ^b
Returns: World -> unit

lens /= value

Full Usage: lens /= value

Parameters:
    lens : Lens<^a, 'c>
    value : ^b

Returns: World -> unit
Modifiers: inline
Type parameters: 'c

Divides the lensed property's value. Throws an exception if the lens is readonly.

lens : Lens<^a, 'c>
value : ^b
Returns: World -> unit

lens <-- value

Full Usage: lens <-- value

Parameters:
    lens : Lens<'a, 'b>
    value : 'a

Returns: World -> unit
Modifiers: inline

Set a lensed property's value. Throws an exception if the lens is readonly.

lens : Lens<'a, 'b>
value : 'a
Returns: World -> unit

~+lens

Full Usage: ~+lens

Parameters:
    lens : Lens<^a, 'b>

Returns: World -> unit
Modifiers: inline

Negates the lensed property's value. Throws an exception if the lens is readonly.

lens : Lens<^a, 'b>
Returns: World -> unit

~-lens

Full Usage: ~-lens

Parameters:
    lens : Lens<^a, 'b>

Returns: World -> unit
Modifiers: inline

Negates the lensed property's value. Throws an exception if the lens is readonly.

lens : Lens<^a, 'b>
Returns: World -> unit

Type something to start searching.