%% %CopyrightBegin%
%%
%% SPDX-License-Identifier: Apache-2.0
%%
%% Copyright Ericsson AB 2021-2025. All Rights Reserved.
%%
%% %CopyrightEnd%

[;1m  hd(List)[0m

  Returns the head of [;;4mList[0m, that is, the first element.

  It works with improper lists.

  Examples:

    > hd([1,2,3,4,5]).
    1

    > hd([first, second, third, so_on | improper_end]).
    first

  Failure: [;;4mbadarg[0m if [;;4mList[0m is an empty list [;;4m[][0m.
