A vector of length 41
Internal.Vector41 a
A vector that contains exactly 41 elements
fromList : List a -> Maybe ( List a, Vector41 a )
Turn a List a
into a Vector41 a
. If there are not enough items in the List a
, then this function returns Nothing
. The extra items in the input list, if there are any, is returned as the first element in the output tuple.
Vector3.fromList []
--> Nothing
Vector3.fromList [ 1 ]
--> Nothing
Vector3.fromList [ 5, 6, 7, 8 ]
--> Just ([ 8 ], Vector3.from3 5 6 7)
repeat : a -> Vector41 a
Make a Vector41 a
filled with just one item repeated over and over again.
from41 : a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> Vector41 a
Make a Vector41 a
from 41 elements
fromListWithDefault : a -> List a -> ( List a, Vector41 a )
Turn a List a
into a Vector41 a
. If there are not enough items in the List a
, then fill in the remaining spots with a default value. The extra items in the input list, if there are any, is returned as the first element in the output tuple.
Vector3.fromListWithDefault 1 []
--> ([] ,Vector3.from3 1 1 1)
Vector3.fromListWithDefault 2 [ 1 ]
--> ([], Vector3.from3 1 2 2)
Vector3.fromListWithDefault 2 [ 5, 6, 7, 8 ]
--> ([ 8 ], Vector3.from3 5 6 7)
initializeFromInt : (Basics.Int -> a) -> Vector41 a
Make a Vector41 a
using a function that takes an Int
, representing the index
initializeFromIndex : (Index -> a) -> Vector41 a
Make a Vector41 a
using a function that takes an Index
All the indices to a Vector41 a
. There are exactly 41 of them. Its kind of like an Int
except there is a finite amount of them.
get : Index -> Vector41 a -> a
Get the item at that Index
in a Vector41 a
set : Index -> a -> Vector41 a -> Vector41 a
Set the item at a specific index in a Vector41 a
indices : Vector41 Index
A list of all the indices, from 0 to 40
indexToInt : Index -> Basics.Int
Turn the Index
into an Int
intToIndex : Basics.Int -> Maybe Index
Try and turn an Int
into an Index
, returning Nothing
if the Int
is above the maximum index, or below the zero index, of this Vector41 a
Vector5.intToIndex 4
--> Just Vector5.Index4
Vector3.intToIndex 4
--> Nothing
nextIndex : Index -> Maybe Index
Given an index, get the next one. Unless its the last index in which case there is no next index (Nothing
)
previousIndex : Index -> Maybe Index
Given an index, get the previous one. Unless its the 0
index in which case there is no previous index (Nothing
)
map : (a -> b) -> Vector41 a -> Vector41 b
Apply a function to every element in a Vector41 a
.
mapItem : Index -> (a -> a) -> Vector41 a -> Vector41 a
Transform just one particular item at a particular Index
indexedMap : (Index -> a -> b) -> Vector41 a -> Vector41 b
Apply a function on every element with its index as first argument
foldr : (a -> b -> b) -> b -> Vector41 a -> b
Reduce a Vector41 a
from the right.
foldl : (a -> b -> b) -> b -> Vector41 a -> b
Reduce a Vector41 a
from the left.
map2 : (a -> b -> c) -> Vector41 a -> Vector41 b -> Vector41 c
map3 : (a -> b -> c -> d) -> Vector41 a -> Vector41 b -> Vector41 c -> Vector41 d
map4 : (a -> b -> c -> d -> e) -> Vector41 a -> Vector41 b -> Vector41 c -> Vector41 d -> Vector41 e
map5 : (a -> b -> c -> d -> e -> f) -> Vector41 a -> Vector41 b -> Vector41 c -> Vector41 d -> Vector41 e -> Vector41 f
toList : Vector41 a -> List a
Convert a Vector41 a
into a List a
of length 41
toIndexedList : Vector41 a -> List ( Index, a )
Turn a Vector41 a
elm into a list, where each element is paired with its Index
pop : Vector41 a -> ( Vector40.Internal.Vector40 a, a )
Separate a Vector41 a
into its last element and everything else.
Vector4.pop (Vector4.from4 0 1 2 3)
--> (Vector3.from3 0 1 2, 3)
uncons : Vector41 a -> ( a, Vector40.Internal.Vector40 a )
Split a Vector41 a
into its first element and the rest
Vector4.uncons (Vector4.from4 0 1 2 3)
--> (0, Vector3.from3 1 2 3)
push : a -> Vector41 a -> Vector42.Internal.Vector42 a
Add an element to the end of a Vector41 a
, incrementing its size by 1
Vector4.push 4 (Vector4.from4 0 1 2 3)
--> Vector5.from5 0 1 2 3 4
cons : a -> Vector41 a -> Vector42.Internal.Vector42 a
Add an element to the front of a vector, incrementing the vector size by 1
Vector4.cons -1 (Vector4.from4 0 1 2 3)
--> Vector5.from5 -1 0 1 2 3
length : Basics.Int
The length of this vector type, which is 41
reverse : Vector41 a -> Vector41 a
Reverse the order of the items in a Vector41 a
member : a -> Vector41 a -> Basics.Bool
See if a Vector41 a contains a value
group : List a -> ( List a, List (Vector41 a) )
Break a List a
down into groups of Vector41 a
. The output is a tuple, where the left side is a list of the remainder.
Vector3.group [ 1, 2, 3 ]
--> ([] , [ Vector3.from3 1 2 3 ])
Vector3.group [ 1, 2, 3, 4 ]
--> ([ 4 ] , [ Vector3.from3 1 2 3 ])
Vector3.group [ 1, 2, 3, 4, 5 ]
--> ([ 4, 5 ] , [ Vector3.from3 1 2 3 ])
Vector3.group [ 1, 2, 3, 4, 5, 6 ]
--> ([] , [ Vector3.from3 1 2 3, Vector3.from3 4 5 6 ])