# Elixir Prelude

[![Build status]( "Build status")](
[![Hex version]( "Hex version")](
![Hex downloads]( "Hex downloads")

Small set of useful utility functions.

Forked to release on, see:

## Installation

1. Add `elixir_prelude` to your list of dependencies in `mix.exs`:
def deps do
  [{:elixir_prelude, "~> 0.2"}]

## Usage

The most useful utility is provided by Prelude.Map to work with deeply nested Maps or Structs.

defmodule Data do
  defstruct data: %{}

iex> Prelude.Map.deep_put(%Data{}, [:data, :b, :c, :d], 2)
%Data{data: %{b: %{c: %{d: 2}}}}

iex> Prelude.Map.deep_get(%Data{data: %{b: %{c: %{d: 2}}}}, [:data, :b, :c, :d])

iex> Prelude.Map.del_in(%Data{data: %{b: %{c: %{d: 2}}}}, [:data, :b, :c, :d])
%Data{data: %{b: %{c: %{}}}}

Other modules:
  - Prelude.Atom
  - Prelude.List
  - Prelude.String

This package has a set of functions that I extracted from projects I worked on (mainly [this]( Some are very trivial, others (especially in the Prelude.Map module) are more involved. I am mainly putting it together for my own future reuse, but some of it might be useful to others. I would like to add tests, and I will keep adding functions as they come up. Pull requests or suggestions for new functions, better APIs etc are welcome (tests would be awesome).

Stian Håklev,,

See for progress.