head property

Option<T> head

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

Same as firstOption.

Implementation

Option<T> get head {
  var it = iterator;
  if (it.moveNext()) return some(it.current);
  return const None();
}