merl_transform(3erl)

🌸 NAME 🌸

okay so this is merl_transform, and the manual name is Erlang Module Definition β€” yes bestie, we're in Erlang land and it's giving compiler magic ✨.

merl_transform β€” Parse transform for merl.


✨ DESCRIPTION ✨

So <hotpink>merl_transform</hotpink> is the parse transform for merl, no cap. It enables the use of automatic metavariables and using quasi-quotes in matches and case switches πŸŽ€.

It also optimizes calls to functions in merl by partially evaluating them, turning strings to templates, etc., at compile-time πŸ”₯. Yes, she's doing little compile-time glow-ups, iykyk.

Using -include_lib("syntax_tools/include/merl.hrl"). enables this transform, unless the macro MERL_NO_TRANSFORM is defined first 🫢.

🚨 tiny but important vibe check: that MERL_NO_TRANSFORM macro has to be defined first if you want to opt out. The include is what turns the transform on.

πŸ’… EXPORTS πŸ’…

One export, and she's focused:

parse_transform(Forms, Options) -> term()

That's the whole export list β€” parse_transform(Forms, Options) -> term(). Periodt πŸ’….


🫢 AUTHORS 🫢

Richard Carlsson <carlsson.richard@gmail.com> β€” iconic behavior, honestly πŸ‘‘.


πŸ’– source/version sign-off: this page comes from syntax_tools 3.0.1, and the footer has no date shown, so I'm not inventing one. merl_transform(3erl) out β€” periodt πŸŒˆπŸ’…

πŸ“¦ where this page comes from