%{b: b}) but it lacks the data about what it's made from. %{a: a, b: b} == Map.merge(%{}, %{a: a, b: b}) %{a: a, b: b} == Map.merge(%{a: a}, %{b: b}) So map isn't decomposable.
: T -> fun(T, ...) Protocol is extensible, just like a map. Protocols ‑ Elixir https://elixir‑lang.org/getting‑ started/protocols.html Protocols ∙ Elixir School https://elixirschool.com/en/lessons/advanced/protocols/
like STI (single table inheritance) of ActiveRecord/Rails.) defprotocol P do end defmodule A do defstruct [] def type, do: "a" defimpl P do end end data = %{type: "a"} ExampleProtocol |> Protocol.extract_impls([:code.lib_dir(:example, :ebin)]) |> Enum.find(&(&1.type() == data.type)) |> struct(data)
between functions. # Not this f2(f1(data)) data |> f1 |> f2 # This data -> queue -> f1 -> queue -> f2 a.k.a. FRP (functional reactive programming) cf. Redux, rx, clojure/core.async
linguistics (& linguistic AI) have many patterns to treat complex data. Ex. I'm using: α‑Movement Behaviour tree GTTM (Generative Theory of Tonal Music)