Elixir v1.10.0-rc.0 released

@josevalim

Would there be an is_struct/2 version?

defmodule Example do
  defstruct […]

  def sample(struct) when is_struct(struct, __MODULE__), do: {:ok, struct}
  def sample(_), do: :error
end

if not is there any naming convention for it (like we have @type t spec)?

defmodule Example do
  defstruct […]

  @type t :: %__MODULE__{…}

  defguard is_t(struct) when is_struct(struct) and :erlang.map_get(:__struct__, struct) === __MODULE__

  def sample(struct) when is_t(struct), do: {:ok, struct}
  def sample(_), do: :error
end

Would be added also other features discussed in this topic?

Looks like Bob actually sleeps more than a typical human. :smiley:

For sure generally I don’t mind, but if I remember correctly Bob had exactly same problem with at least one previous release as well, so it does not a single standalone edge-case.

Also there are some extra warnings when building elixir at tests step:

2 Likes