FSharpPlus


Vector<'NumType,'Dimension>

This is a fixed size vector of a (typically) numeric type.

Related Tyes

Abstractions

Examples

#r @"nuget: FSharpPlus"
#r @"nuget: FSharpPlus.TypeLevel"
open FSharpPlus
open FSharpPlus.Data


let vector3d_1 = vector (1, 2, 3)
let vector3d_2 = vector (10, 20, 30)


// Add two vectors

let vector3d_sum = vector3d_1 + vector3d_2


// Add a scalar

let vector3d_3 = vector (1, 2, 3) + result 5


// Another way

open FSharpPlus.Math.Generic

let vector3d_4 = vector (1, 2, 3) + 5G
namespace FSharpPlus
namespace FSharpPlus.Data
val vector3d_1: Vector<int,TypeLevel.S<TypeLevel.S<TypeLevel.S<TypeLevel.Z>>>>
val vector: definition: 'a * 'a * .. * 'a -> Vector<'a,'n> (requires member CountTuple and member TupleToList)
val vector3d_2: Vector<int,TypeLevel.S<TypeLevel.S<TypeLevel.S<TypeLevel.Z>>>>
val vector3d_sum: Vector<int,TypeLevel.S<TypeLevel.S<TypeLevel.S<TypeLevel.Z>>>>
val vector3d_3: Vector<int,TypeLevel.S<TypeLevel.S<TypeLevel.S<TypeLevel.Z>>>>
val result: x: 'T -> 'Functor<'T> (requires member Return)
<summary> Lifts a value into a Functor. Same as return in Computation Expressions. </summary>
<category index="2">Applicative</category>
namespace FSharpPlus.Math
module Generic from FSharpPlus.Math
<summary> Generic numbers, functions and operators. By opening this module some common operators become restricted, like (+) to 'T-&gt;'T-&gt;'T </summary>
val vector3d_4: Vector<int,TypeLevel.S<TypeLevel.S<TypeLevel.S<TypeLevel.Z>>>>