Structs

Aug 22, 2023
1 min read 37 words Elixir
Table of Contents

Structs

struct(Struct_name, map) inserts a map into a Struct

Updating structs

# via struct
a = %Computer{id: 1, kind: "laptop"}
struct(a, kind: "server")

# via | cons
a = %{a | kind: "server"}

put_in updates a struct

Send us your comments!