On OTP 24:
iex> <<x::float-16>> = <<60, 0>>
iex> x
1.0
iex> <<x::float-16>>
<<60, 0>>
Before OTP 24 we'd get errors or wouldn't match:
iex> <<1.0::float-16>>
** (ArgumentError) argument error while evaluating iex at line 1
<<x::float-16>> = <<60, 0>>
** (MatchError) no match of right hand side value: <<60, 0>>
iex> (fn <<x::float-16>> -> x; _ -> :nomatch end).(<<60, 0>>)
:nomatch
* Add ISO format examples to the top-level moduledocs.
* Move unit tests out of parse_time/1 documentation and into suite.
* Move unit tests out of parse_naive_datetime/1 documentation and into suite.
* Move unit tests out of parse_utc_datetime/1 documentation and into suite.
* Remove duplicated parse_date/1 doctests, fix missing asserts, other
cleanup.
We haven't added any new rules in a while and
we can assume that users relying on this option
have already rewritten (either manually or
automatically) the current deprecated calls.
- 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)
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
=> "."
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.