VerseIsland
FeedLearnLeaderboardGuidesReferenceExploreSearchDocsVerse Library
Sign in
Feed Learn 📖 Codex Leaderboard Guides Reference Explore Search Docs Verse Library
Browse Community Snippets›Verse Language·Up to Community Snippets · Verse Language·59 of 114 in Verse Language

Array Utilities

Array Utilities

Generic, dependency-free array helpers (IsEmpty, Last, MapTo, Filter, FindFirst, Any, All, CountWhere, Swap) as parametric extension methods.

Original, compile-verified Verse by Bizanator (Biloxi Studios). Clean-room sample you can drop into a UEFN project and adapt.

  • # Array Utilities — Biloxi Studios Inc.
    #
    # Small, generic, dependency-free helpers for working with arrays in Verse,
    # written as parametric (`where t:type`) functions and extension methods so they
    # work for any element type. Import the module and call e.g. `MyArray.IsEmpty[]`.
    #
    # Teaches: parametric types, <decides>/<transacts> effects, extension-method
    # syntax `(Receiver:type).Method()`, predicate callbacks, and option results.
    
    using { /Verse.org/Simulation }
    
    array_utils<public> := module:
    
        # Succeeds when the array has no elements. Use in a failure context:
        #   if (MyArray.IsEmpty[]) { ... }
        (Source:[]t where t:type).IsEmpty<public>()<decides><transacts>:void =
            Source.Length = 0
    
        # Return the last element, or false (the empty option) when the array is empty.
        (Source:[]t where t:type).Last<public>()<transacts>:?t =
            if (Element := Source[Source.Length - 1]):
                option{Element}
            else:
                false

You're reading a preview

The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.

Sign in with Discord — free for members Read the original at Epic Games documentation

Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.

Guided course

Add this to your free study plan — we’ll suggest related material and stitch it into one compile-checked lesson.

Keep exploring
More in Verse Language · 59 of 114
Prev
fortnite matrices
Next
daily reward roller

Source

Epic Games documentation

Bizanator

MIT

View original
VerseIsland· an archipelago of Verse & UEFN knowledge
🗺️ Island atlasLearnGuidesHistoryAbout & PressSources & LicensingPrivacy PolicyTermsStatus

Not affiliated with Epic Games. Fortnite, UEFN, Unreal Engine, and Verse are trademarks of Epic Games, Inc. Content is attributed to its source — see Sources & Licensing.

🦜

Scout · your island guide

The Isle of Verse