• Given a list aList, return its first element.

    Raises an error in case of an empty list.

    head is mostly an alias for car with error handling.

    Parameters

    • aList: List<any>

      the list considered

    Returns any

    • the head of aList if any

    Error - if the list is empty