haxetink / tink_pure

Pure immutable data.
MIT License
10 stars 7 forks source link

List.last() #3

Closed kevinresol closed 6 years ago

kevinresol commented 7 years ago

From Gitter:

Kevin Leung @kevinresol 17:58 btw is there no quick way to get the last item in a list, except iterating it to the end? tink_pure list I mean

Juraj Kirchheim @back2dos 18:10 nah, not really we could track it of course it adds a little bit of overhead, but I guess that'd be fine just add a last field to Node that's also required in the constructor and fix the ensuing compiler errors and it should work (and expose it on the List of course)