Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
0303-erlang-module-doc-Improve-documentation-fo...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0303-erlang-module-doc-Improve-documentation-for-erlang-t.patch of Package erlang
From b78f76fc7722bd74c470c47b6272bc57b0703661 Mon Sep 17 00:00:00 2001 From: Kjell Winblad <kjellwinblad@gmail.com> Date: Thu, 27 Aug 2020 15:02:59 +0200 Subject: [PATCH 03/39] erlang module doc: Improve documentation for erlang:tl/1 * Fix type spec * Add examples for lists of length 1 * Add examples with improper lists --- erts/doc/src/erlang.xml | 9 +++++++++ erts/preloaded/src/erlang.erl | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index b079e11ef0..73dbde42f6 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -10407,6 +10407,15 @@ timestamp() -> <pre> > <input>tl([geesties, guilies, beasties]).</input> [guilies, beasties]</pre> + <pre> +> <input>tl([geesties]).</input> +[]</pre> + <pre> +> <input>tl([geesties, guilies, beasties | improper_end]).</input> +[guilies, beasties | improper_end]</pre> + <pre> +> <input>tl([geesties | improper_end]).</input> +improper_end</pre> <p>Allowed in guard tests.</p> <p>Failure: <c>badarg</c> if <c><anno>List</anno></c> is the empty list <c>[]</c>.</p> diff --git a/erts/preloaded/src/erlang.erl b/erts/preloaded/src/erlang.erl index 8f4c09e56d..7b054b84b7 100644 --- a/erts/preloaded/src/erlang.erl +++ b/erts/preloaded/src/erlang.erl @@ -2622,7 +2622,7 @@ term_to_iovec(_Term, _Options) -> %% Shadowed by erl_bif_types: erlang:tl/1 -spec tl(List) -> term() when - List :: [term(), ...]. + List :: nonempty_maybe_improper_list(). tl(_List) -> erlang:nif_error(undefined). -- 2.26.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor