cometia0/messenger-core/2.0.0

Messenger.RecursionArray

RecursionArray

Array implementation for the recursion algorithm

updateObjects : RecBody a b c d -> c -> b -> Array a -> ( Array a, List b, c )

Recursively update all the objects in the List

RecBody a b c d
-> c
-> List ( d, b )
-> Array a
-> ( Array a, List b, c )

Recursively update all the objects in the Array, but also uses target

Tools

getObjectIndices : Matcher a d -> d -> Array a -> List Int

Get the indices of the objects that match the target

getObjectIndex : Matcher a d -> d -> Array a -> Maybe Int

Get the index of the object that matches the target (the first one)

TODO: use better algorithm

getObjects : Matcher a d -> d -> Array a -> Array a

Get the objects that match the target

getObject : Matcher a d -> d -> Array a -> Maybe a

Get the object that matches the target (the first one)

RecBody a b c d
-> c
-> b
-> Int
-> Array a
-> ( Array a, List ( d, b ), c )

Update the object by index

RecBody a b c d
-> c
-> b
-> d
-> Array a
-> ( Array a, List ( d, b ), c )

Update all the objects that match the target