# \#access

**URL:** https://forum.elixirforum.com/tag/access/234.md

[Latest](https://forum.elixirforum.com/latest.md) · [Categories](https://forum.elixirforum.com/categories.md) · [Tags](https://forum.elixirforum.com/tags.md)

---

## [Pathex - a library for performing fast actions with nested data structures](https://forum.elixirforum.com/t/pathex-a-library-for-performing-fast-actions-with-nested-data-structures/47754)

<div class="topic-metadata">

**Author:** [@hst337](https://forum.elixirforum.com/u/hst337)\
**Replies:** 22\
**Last updated:** [May 2, 2025, 5:02pm UTC](https://forum.elixirforum.com/t/pathex-a-library-for-performing-fast-actions-with-nested-data-structures/47754 "2025-05-02T17:02:05Z")

</div>

Hi there, I’ve been working on a Pathex library for quite a while now, and I’ve finally managed to create a release which is able to cover all requirements in nested structures access. Think of Pathex as Elixir’s Access …

---

## [Example of implementing Access protocol (behaviour?) in Struct](https://forum.elixirforum.com/t/example-of-implementing-access-protocol-behaviour-in-struct/28482)

<div class="topic-metadata">

**Author:** [@fireproofsocks](https://forum.elixirforum.com/u/fireproofsocks)\
**Replies:** 10\
**Last updated:** [March 31, 2025, 9:35am UTC](https://forum.elixirforum.com/t/example-of-implementing-access-protocol-behaviour-in-struct/28482 "2025-03-31T09:35:16Z")

</div>

I stumbled across the desire to want to use get\_in while accessing deeply nested parts of a custom struct while needing to provide a default value. I could make a simple defp function to achieve this, but I wanted to se…

---

## [Override Access.get to support using brackets to access an index of a list](https://forum.elixirforum.com/t/override-access-get-to-support-using-brackets-to-access-an-index-of-a-list/69087)

<div class="topic-metadata">

**Author:** [@user20230119](https://forum.elixirforum.com/u/user20230119)\
**Replies:** 2\
**Last updated:** [January 30, 2025, 4:38am UTC](https://forum.elixirforum.com/t/override-access-get-to-support-using-brackets-to-access-an-index-of-a-list/69087 "2025-01-30T04:38:10Z")

</div>

I want to use get\_in(data, keys) for a nested map with some values having a list with maps. map = %{a: 1, aa: \[%{b: 2}, %{bb: 22}\], aaa: 111} get\_in(map, \[:aa, 1, :bb\]) # =\> 22 Is there a way to override Access.get to …

---

## [Update shorthand for Access behavor](https://forum.elixirforum.com/t/update-shorthand-for-access-behavor/60537)

<div class="topic-metadata">

**Author:** [@7rans](https://forum.elixirforum.com/u/7rans)\
**Replies:** 24\
**Last updated:** [January 25, 2024, 2:52pm UTC](https://forum.elixirforum.com/t/update-shorthand-for-access-behavor/60537 "2024-01-25T14:52:52Z")

</div>

I implemented Access behavior for a struct today. Pseudo-code… defmodule MyStruct do defstruct data: %{} @behaviour Access # ... implementation of Access behavior on \`data\` ... end Then I tried: a = %{x: 1, y…

---

## [Help composing/abstracting list of keys to traverse nested data structures using the Access module](https://forum.elixirforum.com/t/help-composing-abstracting-list-of-keys-to-traverse-nested-data-structures-using-the-access-module/53281)

<div class="topic-metadata">

**Author:** [@codeanpeace](https://forum.elixirforum.com/u/codeanpeace)\
**Replies:** 5\
**Last updated:** [January 20, 2023, 3:45am UTC](https://forum.elixirforum.com/t/help-composing-abstracting-list-of-keys-to-traverse-nested-data-structures-using-the-access-module/53281 "2023-01-20T03:45:25Z")

</div>

Hello, I’m looking to dry up some LiveView handle\_info/event callbacks that require modifying a nested data structure using update\_in/3 in response to CRUD, or rather CUD, actions. The second parameter for update\_in/3 is…

---

## [Access attribute in list of lists](https://forum.elixirforum.com/t/access-attribute-in-list-of-lists/51732)

<div class="topic-metadata">

**Author:** [@Rory](https://forum.elixirforum.com/u/Rory)\
**Replies:** 3\
**Last updated:** [November 11, 2022, 9:51pm UTC](https://forum.elixirforum.com/t/access-attribute-in-list-of-lists/51732 "2022-11-11T21:51:22Z")

</div>

Hi, Been lurking here for a while (that is, via google), gotten a lot of help from people’s Q&As in the past, but I’ve gotten stuck on something that I don’t quite see an answer for in the documentation or the forums he…

---

## [How to recurse and build a key to access a child node](https://forum.elixirforum.com/t/how-to-recurse-and-build-a-key-to-access-a-child-node/43041)

<div class="topic-metadata">

**Author:** [@dredison](https://forum.elixirforum.com/u/dredison)\
**Replies:** 2\
**Last updated:** [October 13, 2021, 12:44pm UTC](https://forum.elixirforum.com/t/how-to-recurse-and-build-a-key-to-access-a-child-node/43041 "2021-10-13T12:44:23Z")

</div>

Hi, So I’m new to Elixir and I’m struggling with a recursion question. I have a tree structure (of structs, with ordered lists of children), where each node has a single parent and many children. it can be nested to a…

---

## [Access behavior / protocol / macro for custom type](https://forum.elixirforum.com/t/access-behavior-protocol-macro-for-custom-type/38414)

<div class="topic-metadata">

**Author:** [@rm-rf-etc](https://forum.elixirforum.com/u/rm-rf-etc)\
**Replies:** 4\
**Last updated:** [March 24, 2021, 7:28am UTC](https://forum.elixirforum.com/t/access-behavior-protocol-macro-for-custom-type/38414 "2021-03-24T07:28:21Z")

</div>

I’m creating a custom type and I need to define original logic for the square bracket operator. How do I go about doing this? Do I use defimpl to define a protocol, or write a macro, or use Access behavior? Or some combi…

---

## [Updating structs: Map.put vs %Foo{oldfoo | new: value} vs put\_in](https://forum.elixirforum.com/t/updating-structs-map-put-vs-foo-oldfoo-new-value-vs-put-in/4246)

<div class="topic-metadata">

**Author:** [@Qqwy](https://forum.elixirforum.com/u/Qqwy)\
**Replies:** 31\
**Last updated:** [July 4, 2020, 6:01am UTC](https://forum.elixirforum.com/t/updating-structs-map-put-vs-foo-oldfoo-new-value-vs-put-in/4246 "2020-07-04T06:01:18Z")

</div>

Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. In the (beta version of the) book, they update structs using Map.put/3. I’ve found …

---

## [Access on structs with typed members](https://forum.elixirforum.com/t/access-on-structs-with-typed-members/22584)

<div class="topic-metadata">

**Author:** [@saverio-kantox](https://forum.elixirforum.com/u/saverio-kantox)\
**Replies:** 5\
**Last updated:** [May 21, 2019, 9:17pm UTC](https://forum.elixirforum.com/t/access-on-structs-with-typed-members/22584 "2019-05-21T21:17:09Z")

</div>

In a project I’m working in, I have to create a boatload of different structs, each containing a list of different types of objects. Think XML with types. The values cannot be set directly on fields because order must be…

---

## [Inherit behaviour from Map to implement Access](https://forum.elixirforum.com/t/inherit-behaviour-from-map-to-implement-access/20161)

<div class="topic-metadata">

**Author:** [@mxst](https://forum.elixirforum.com/u/mxst)\
**Replies:** 2\
**Last updated:** [February 16, 2019, 6:15am UTC](https://forum.elixirforum.com/t/inherit-behaviour-from-map-to-implement-access/20161 "2019-02-16T06:15:07Z")

</div>

Hey everyone. I’m trying to use my own struct (as a extension of map) in my code but I would really love to use the Methods from the Access behaviour. Is there an easy way to achieve this? defmodule SemanticConcept do …

---

## [Access.pop - unexpected behavior](https://forum.elixirforum.com/t/access-pop-unexpected-behavior/15393)

<div class="topic-metadata">

**Author:** [@auua](https://forum.elixirforum.com/u/auua)\
**Replies:** 3\
**Last updated:** [July 27, 2018, 11:32pm UTC](https://forum.elixirforum.com/t/access-pop-unexpected-behavior/15393 "2018-07-27T23:32:54Z")

</div>

Hi guys! I’ve been learning some elixir following Dave’s Programming Elixir 1.6 and I’m lovin it! I just came across Access.pop/2 and noticed something weird when experimenting with the function. Access.pop(\[ a: 1, a: …

---

## [Why are the accessor functions in Access strict?](https://forum.elixirforum.com/t/why-are-the-accessor-functions-in-access-strict/15137)

<div class="topic-metadata">

**Author:** [@tsutsu](https://forum.elixirforum.com/u/tsutsu)\
**Replies:** 0\
**Last updated:** [July 13, 2018, 6:21pm UTC](https://forum.elixirforum.com/t/why-are-the-accessor-functions-in-access-strict/15137 "2018-07-13T18:21:44Z")

</div>

get\_in and its related lensing macros have the “default” or “built-in” behavior (for Map keys, the only thing they support by default) of being forgiving when you attempt to navigate further from a non-existent key. For …

---

## [The issue with the static access operator (the dot)](https://forum.elixirforum.com/t/the-issue-with-the-static-access-operator-the-dot/4509)

<div class="topic-metadata">

**Author:** [@Qqwy](https://forum.elixirforum.com/u/Qqwy)\
**Replies:** 24\
**Last updated:** [April 13, 2017, 3:49pm UTC](https://forum.elixirforum.com/t/the-issue-with-the-static-access-operator-the-dot/4509 "2017-04-13T15:49:26Z")

</div>

I would like to spark a discussion about the static access operator: .. For whom does not know: it is used in Elixir to access fields of a struct or map, where you want to be sure (/are sure) that a given (atom) key exi…
