Verse Library verse

03 Type Aliasing

Defines a callable type alias and uses it to filter integers based on a predicate.

extracted-snippets/documentation/en-us/uefn/type-aliasing-in-verse/03-type-aliasing.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/type-aliasing-in-verse
# Local doc:  epic-docs/documentation/en-us/uefn/type-aliasing-in-verse.md
# Section:    Type Aliasing
int_predicate := type{_(:int)<transacts><decides> : void}
Filter(X : []int, F : int_predicate) : []int =
for (Y : X, F[Y]):
Y

Comments

    Sign in to vote, comment, or suggest an edit. Sign in