Parse transform for fast record to map and map to record conversions without boilerplate for Erlang.
Add dependency to your rebar.config
{deps, [
{rconv, {git, "https://github.com/Yozhig/rconv.git", {tag, "0.2.0"}}},
]}
and compile option for parse transform at the top of the source file
-module(your_module_name).
-compile([{parse_transform, rconv}]).
or to an erl_opts
.
Now you can use rconv:to_map/2 and rconv:from_map/2 which will be transformed at the compile time
Map = rconv:to_map(Record, your_record_name),
Record = rconv:from_map(Map, your_record_name)
See unit tests for sample usage.