erl_internal(3)
π erl_internal π
okay bestie, welcome to the erl_internal page β this is from the Erlang Module Definition corner of the manual, and it's lowkey the vibes-only module you only meet if you're out here doing code gymnastics π
πΈ NAME πΈ
erl_internal β internal Erlang definitions, periodt.
β¨ DESCRIPTION β¨
So this module is where Erlang's BIFs, guard tests, and operators get their whole definition. That's the whole personality.
But listen: this module is only of interest to programmers who manipulate Erlang code. Like, if you're not out there messing with abstract forms and compiler internals, this is not your girl. No shade. It's just giving "you had to be there" energy. π¦
π FUNCTIONS π
add_predefined_functions
add_predefined_functions(Forms) -> UpdatedForms
when
Forms ::
[erl_parse:abstract_form() |
erl_parse:form_info()],
UpdatedForms ::
[erl_parse:abstract_form() |
erl_parse:form_info()].
This one takes your Forms and glow-ups them by adding in the code for the standard pre-defined functions (think things like module_info/0) that every module is supposed to carry around. Every module. No exceptions, bestie. π«Ά
arith_op
arith_op(OpName, Arity) -> boolean()
when OpName :: atom(), Arity :: arity().
Returns true if OpName/Arity is an arithmetic operator. Otherwise it's giving false. π
bif
bif(Name, Arity) -> boolean()
when Name :: atom(), Arity :: arity().
Returns true if Name/Arity is an Erlang BIF that the compiler automatically recognizes β like, it just knows them, main character BIFs β¨ β otherwise false.
bool_op
bool_op(OpName, Arity) -> boolean()
when OpName :: atom(), Arity :: arity().
Returns true if OpName/Arity is a Boolean operator, otherwise false. Simple. Iconic.
comp_op
comp_op(OpName, Arity) -> boolean()
when OpName :: atom(), Arity :: arity().
Returns true if OpName/Arity is a comparison operator, otherwise false. Yes queen, go off with your < and your = comparisons.
guard_bif
guard_bif(Name, Arity) -> boolean()
when Name :: atom(), Arity :: arity().
Returns true if Name/Arity is an Erlang BIF that's allowed to show up in guards β the VIP section of Erlang, only certain BIFs get in π₯ β otherwise false.
list_op
list_op(OpName, Arity) -> boolean()
when OpName :: atom(), Arity :: arity().
Returns true if OpName/Arity is a list operator, otherwise false. Love that for lists. π
op_type
op_type(OpName, Arity) -> Type
when
OpName :: atom(),
Arity :: arity(),
Type :: arith | bool | comp | list | send.
This is the "what's your type" function, literally. It hands you back the Type of operator that OpName/Arity belongs to. The options are arith, bool, comp, list, or send.
β οΈ and if it's not an operator at all? It generates a function_clause error. So, like, do a vibe check before you call it, okay? π
send_op
send_op(OpName, Arity) -> boolean()
when OpName :: atom(), Arity :: arity().
Returns true if OpName/Arity is a send operator, otherwise false. Sending messages AND sending receipts, honestly. π
type_test
type_test(Name, Arity) -> boolean()
when Name :: atom(), Arity :: arity().
Returns true if Name/Arity is a valid Erlang type test, otherwise false. Last one, and she ate π
that's the whole page, bestie, you made it to the end π§ no cap π«Ά
Ericsson AB Β· stdlib 8.0.4 β that's the source and version, and the page is erl_internal(3). mwah, take care of her ππ
π¦ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms