Skip to content

How to access an element in a list? #3965

Discussion options

You must be logged in to vote

You don't want to do list access in gleam. Gleam's lists are linked lists, meaning it's O(n) to access an element. You should model your problem differently.

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@Hurricane996
Comment options

@giacomocavalieri
Comment options

@lpil
Comment options

lpil Apr 29, 2025
Maintainer

Answer selected by lemorage
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@lpil
Comment options

lpil Apr 22, 2025
Maintainer

@leobm
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants