Quick Start

Makrell# is designed to feel familiar to Makrell users while fitting naturally into the .NET world.

How to use this page

This page gives a short tour of the main shapes you are likely to encounter first:

  • ordinary function and pipeline syntax

  • .NET interop

  • pattern matching

  • the baseline async/await surface

For setup details, see Installation. For broader usage patterns, continue to Guide and Cookbook.

Representative example

{fun add [x y]
    x + y}

add3 = {add 3 _}
[2 5 8] | {map add3} | sum

This shows the compact functional flow that Makrell# shares with the rest of the family.

Representative interop example

{import System.Text}
sb = {new StringBuilder []}
{sb.Append "Makrell#"}
{sb.ToString}

This shows the basic .NET pattern: import a CLR namespace or type, construct an object, then call members through ordinary Makrell syntax.

Pattern-matching example

{match [2 5]
    [x=_ y=_]
        {when x < y
            x + y}
    _
        0}

This shows that Makrell# is not only about CLR interop. It also carries shared family language features such as structural matching.

Async example

{async fun fetchValue [value]
    value}

{async fun addLater [x y]
    left = {await {fetchValue x}}
    right = {await {fetchValue y}}
    left + right}

{await {addLater 20 22}}

Makrell# now supports the shared family baseline of {async fun ...} and {await ...} in addition to the more established sync/core surface.

Practical next steps

After working through these examples, a useful next route is:

  1. read Guide for the main language model in the .NET track

  2. use Cookbook for concrete tasks

  3. continue with Interop if .NET libraries are your main interest

  4. continue with Macros and Meta if compile-time behaviour is your main interest

See also the implementation docs in the repo under impl/dotnet/.