head property

Option<T> head

Get the first element of the list. If the list is empty, return None.

Same as firstOption.

Implementation

Option<T> get head => isEmpty ? none() : some(first);