Ark (ark v0.6.0) View Source

Ark is a collection of small utilities useful for prototyping, testing, and working with Elixir common patterns.

Utilities

Ark.Drip

This module implements a GenServer and allows to throttle calls to a common resource.

Ark.Ok

This module provides function to work with ok/error tuples.

Ark.PipeIn

This module provides a macro to set a variable from the end of a pipe.

use Ark.PipeIn

:val
|> Atom.to_string()
|> String.upcase()
~> my_value

IO.inspect(my_value, label: "my_value")

# my_value: "VAL"

Ark.StructAccess

This module provides a simple way to implement the Access behaviour for any struct.

Example

iex> defmodule MyStruct do
...>   defstruct k: nil
...>   use Ark.StructAccess
...> end
iex> s = %MyStruct{k: 1}
iex> put_in(s.k, 2)
%MyStruct{k: 2}