Zulip Chat Archive
Stream: Is there code for X?
Topic: List.last' and List.head?
Xavier Xarles (Mar 27 2024 at 11:44):
When one has a list L, then docs#List.last' gives you either the last element of the list, or none if the list is empty. If one wants the same but for the first element of the list, is it true that the equivalent version is docs#List.head? ? As there is no explanation, I am not completely sure...
Kim Morrison (Mar 27 2024 at 11:48):
Note that List.last'
has been deprecated in favour of List.getLast?
. So it's not quite as inconsistent as it first looks. :-)
Last updated: May 02 2025 at 03:31 UTC