Skip to content

bopjesvla/axe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Axe

The access sigil

Motivation

Updating nested data structures in Elixir can be tricky. The macro variant of Kernel.*_in is alright, but it cannot be piped and it only supports maps and keyword lists.

Examples

import Axe

...

%{z: [%{b: 2}, %{b: 6}], x: %{q: 0}}
|> put_in(~a[x.q], 3)
|> update_in(~a[z.*.b], & &1 + 1)
|> update_in(~a[z.@0.b], & &1 + 100)
# %{z: [%{b: 103}, %{b: 7}], x: %{q: 3}}

Installation

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

About

The access sigil

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages