Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

hailelagi/ex_vec

Repository files navigation

ExVec

re-creating rust's vec! macro in elixir, read about it here!

Example

defmodule MyApp.DoStuff do
  use ExVec, implementation: :rust

  def len do
    vec!(1..5) |> Enum.count()
  end

  def map_by_2 do
    vec!(1..5) |> Enum.map(fn n -> n * 2 end)
  end
end

Installation

If available in Hex, the package can be installed by adding ex_vec to your list of dependencies in mix.exs:

def deps do
  [
    {:ex_vec, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ex_vec.