First Program in MakrellPy¶
This short tutorial shows a minimal MakrellPy workflow: install the package, start the REPL, define a function, and run a small pipeline.
Install MakrellPy¶
pip install makrell
Start the REPL¶
makrell
Try this program¶
{fun add [x y]
x + y}
add3 = {add 3 _}
[2 5 8] | {map add3} | sum
What this does¶
This small program shows:
function definition with
funplaceholder-based partial application
pipeline-oriented flow
More concretely:
adddefines a two-argument functionadd3fixes the first argument and leaves the second open with_the final pipeline maps that function over a list and sums the result
Why this is a good first example¶
It introduces several recurring Makrell ideas in a small space:
a compact structural function form
functional composition through partial application
left-to-right pipeline style
Those are not unique to MakrellPy, but MakrellPy is a good place to encounter them first because the Python track has a broad and practical language surface.
Next steps¶
Continue with: