<aside> đź’ˇ The Reference Rule states that whenever the type comment of a self-referential data type references another non-primitive data type, a natural helper (processing the other data type) should be written within a function template of the self-referential data type.
</aside>
Data definitions which are subject to the reference rule
The data definition for ListOfSchool
references School
. As a result, the function template for fn-for-los
(a function for ListOfSchool
) will feature fn-for-school
(a function for School
) as a natural helper.
Natural helpers in the templates are the precursors for actual helper functions.
When designing function templates with natural helpers within them,
<aside>
🧠When you ultimately get to designing the function template for the natural helper, take reference from the check-expect
examples written in the self-referential function template. In fact, you might be able to copy some important details from the examples to the helper function definition (but certainly not the other way round).
</aside>