hailelagi / ex_vec

re-creating rust's `vec!` macro in elixir

Home Page:https://www.hailelagi.com/writing/legos/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

re-creating rust's `vec!` macro in elixir

https://www.hailelagi.com/writing/legos/

License:MIT License


Languages

Language:Elixir 81.8%Language:Rust 18.2%