Commit Graph
9139 Commits
Author SHA1 Message Date
Julian Doherty 199d66ca2c Improve Enum.chunk_while/4 docs to clarify after_fun semantics (#10595)
- add `{:halt, acc}` tuple return doc for `chunk_fun`
- explain `after_fun` semantics in more detail
- format return tuples for `chunk_fun` and `after_fun` as markdown lists
- added note that `acc` in `after_fun` return tuple is ignored
- note that `Enum.chunk_while/4` returns a list of *chunks*, not a list
  of lists (emitted chunks can be anything, not necessarily just lists)
2021-01-02 16:29:20 +01:00
José Valim a7b1e6e1f7 Clarify writing documentation guide, closes #10610 2021-01-02 16:26:06 +01:00
José Valim a94d5b80b5 Do not break inside interpolation
Closes #10587
2021-01-02 16:20:39 +01:00
Eksperimental 683231a19f Add Collectable.into/1 to Deprecation list & update Enum.into/2 doc (#10615) 2020-12-31 19:31:57 +01:00
Aleksei Matiushkin 33e41117ea Return :error on decomposing regular tuples as calls (#10612)
This makes two-elem and n-elem tuples consistent.
2020-12-31 10:12:58 +01:00
Guilherme 'nirev' de Maio 4605ef79b5 Fix small typo in pipe operator doc (#10606) 2020-12-30 08:47:24 +01:00
Eksperimental 075faf7870 Stremaline specs in Kernel.{tap, then}/2 (#10608)
x is not used anywhere in the specs. Use name of argument instead.
2020-12-30 08:46:06 +01:00
Eksperimental c7a4b3af37 Improve grammar in IO (#10607) 2020-12-30 08:45:40 +01:00
Eksperimental 25408f9934 Extend functions/macros not allowed inside Protocols (#10605) 2020-12-30 01:12:28 +01:00
felipe stival 0ca409e4f5 Add Kernel.tap/2 (#10604) 2020-12-29 21:03:41 +01:00
Tomasz Marek Sulima ca5700678e Add Kernel.then/2 (#10603) 2020-12-29 20:58:41 +01:00
Adam Rutkowski 0ce0ed2229 Fix Path.relative_to/2 when referencing self (#10601)
If `relative_to` argument points at `path`, the
result should be relative.

Currently it's:

    iex(1)> Path.relative_to('/foo/bar', '/foo/bar') |> Path.type()
    :absolute

This patch fixes it, so it's:

    iex(1)> Path.relative_to('/foo/bar', '/foo/bar')
    "."
    iex(2)> Path.type(v(1))
    :relative

Similar code in python:

    In [1]: os.path.relpath('/foo/bar', start='/foo/bar')
    Out[1]: '.'

And in ruby:

    > Pathname.new('/foo/bar').relative_path_from(Pathname.new('/foo/bar')).to_s
    => "."
2020-12-29 12:57:02 +01:00
Eksperimental 6308342d68 Add @deprecated attribute to macros in Behaviour (#10597) 2020-12-28 10:49:32 +01:00
José Valim e666ec5b6f Simplify import handling in lexical tracker 2020-12-26 20:24:23 +01:00
José Valim bad5844c92 Set evaluation to empty space to fix string replace on batch, closes #10495 (#10586) 2020-12-21 16:22:55 +01:00
José Valim 3c77ef61a3 Also warn for literal structs on min/max 2020-12-18 17:55:29 +01:00
John Bampton 0716ef4753 Fix spelling (#10583) 2020-12-17 16:08:42 +01:00
José Valim 7e84a615c1 Do not warn for attributes used in after_compile
Closes #10579.
2020-12-17 13:05:02 +01:00
Boris Kuznetsov faf1d52b97 Add documentation for Keyword lists with default arguments (#10581) 2020-12-16 15:59:15 +01:00
Eksperimental b5e39f3dc1 Improve documentation for Protocol module (#10580) 2020-12-16 07:00:09 +01:00
Boris Kuznetsov 1119c7e1a4 Documentation for multiple values in case (#10576) 2020-12-14 19:27:58 +01:00
Wojtek Mach bf8708bef7 Update task.ex (#10574) 2020-12-14 07:28:45 +01:00
José Valim 7d2704dedb Revert "Improve perf for Integer.gcd (#10571)" (#10572)
This reverts commit b18bf3aa80.
2020-12-13 18:08:58 +01:00
Thomas Cioppettini 52bb48c26b Simplify Enum.each/2 (#10570)
:lists.foreach already returns an :ok atom,
so we don't need to add another one.
2020-12-13 17:18:38 +01:00
Thomas Cioppettini b18bf3aa80 Improve perf for Integer.gcd (#10571)
If the two integers are equal to one another,
we can immediately exit.
2020-12-13 17:18:05 +01:00
John Bampton 35dde790f0 Remove trailing whitespace from ex file (#10569) 2020-12-13 13:35:21 +01:00
Eksperimental 4e14051ee6 Make comment unambiguous (#10568)
The v2.0 could be interpretted as if it refering to the defstruct
version, which by the way it is already number 2.
2020-12-13 13:16:14 +01:00
José Valim b24af8ba2d Do not discard context from with, closes #10538 2020-12-13 09:19:12 +01:00
José Valim b4f4cd433c Fix variable overriding in records, closes #10540 2020-12-13 09:05:03 +01:00
Eksperimental f61d3a5fd8 Fix function arity in Task.await/2 doc (#10564) 2020-12-12 17:27:02 +01:00
José Valim f8582221b5 Avoid computing powers if possible 2020-12-12 17:24:52 +01:00
José Valim 34956c3537 Add an example of handling tasks inside a GenServer 2020-12-12 12:14:07 +01:00
José Valim b1de2eb642 Deprecate use EEx.Engine in favor of explicit delegation 2020-12-11 21:52:27 +01:00
Jon Rowe f2c66a9dee Add offset to DateTime.to_iso8601/2 (making it to_iso8601/3) (#10315) 2020-12-11 19:28:23 +01:00
Hissssst 34cfd9125d Fix GenServer option typespec (#10563) 2020-12-11 13:30:52 +01:00
Eric Meadows-Jönsson 77fcc62f6c Fix bootstrap error 2020-12-10 15:42:06 +01:00
José Valim 5c63dfe68d Do not use unicode chars if ANSI is disabled
See https://github.com/elixir-lang/elixir/issues/10481#issuecomment-742448132
2020-12-10 12:18:39 +01:00
José Valim 0323dd2ac4 Improve error message on do-block in module attr, closes #10544 2020-12-10 12:12:14 +01:00
Eksperimental 9ae8ae86c7 Add left out clarification in Enumerable count (#10560)
Mention that when we say that "you can count" is
without traversing the whole collection.
This was left out in ea637a7a0e
2020-12-10 06:37:07 +01:00
felipe stival 02b649090e Add Enum.product/1 (#10559) 2020-12-09 23:23:26 +01:00
James Duncombe 4714b92a29 Fix typo in Module documentation (#10558) 2020-12-09 18:34:12 +01:00
Vicente Merlo fe1df769b9 Add offset option to Regex.scan/3 and Regex.run/3 (#10555) 2020-12-09 18:15:41 +01:00
Fernando Tapia Rico 9a2b71800b Doc Enum.with_index fun expects a zero-based index (#10556) 2020-12-09 17:25:26 +01:00
felipe stival a979b882f9 Add support for functions on Enum.with_index/2 (#10552)
Makes Enum.with_index/2 supports both functions and offsets by setting
a default function (fn element, index -> {element, index} end) and
a default offset (0) and letting the user change one of them on the
second argument.
2020-12-09 15:35:19 +01:00
Wojtek Mach 774b87ba19 Update Tuple.sum and Tuple.product docs (#10554) 2020-12-09 15:34:47 +01:00
Tomasz Marek Sulima ada51b2d96 Add Tuple.sum/1 (#10551) 2020-12-09 14:35:01 +01:00
Tomasz Marek Sulima 9d24e79ba9 Add Tuple.product/1 (#10550) 2020-12-09 14:33:19 +01:00
José Valim 49efee9cc1 Do not match on error_info on OTP 24 2020-12-08 17:40:13 +01:00
Eksperimental ea637a7a0e Be clearer about Enumerable.count/1 implementations (#10542)
It should return {:ok, count} when we can count the number of elements
without traversing the enumerable.
2020-12-08 17:35:06 +01:00
Eksperimental 4b397e2e70 Hide Enumerable.List.slice/4 function (#10541) 2020-12-08 17:33:55 +01:00