Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Inline docs and annotation

The language server picks up plain comments as documentation. No new syntax, just comments in the right spot, written in Markdown.

Above an assignment: consecutive -- lines right before it, no blank line between.

-- Number of edges of `G` between the vertices in `S`.
-- See also [[inducedSubgraph]].
edgesWithin = (G, S) -> #edges inducedSubgraph(G, S)

First thing in a function body: a -* … *- block.

edgesWithin = (G, S) -> (
    -* Number of edges of `G` between the vertices in `S`. *-
    #edges inducedSubgraph(G, S)
)

The whole package: a -* … *- block at the top of the file, before newPackage.

[[name]] links to another symbol: it’s clickable in the editor, and it gets updated when you rename that symbol. Code spans and fenced blocks are highlighted as M2.

Annotations that the type checker reads are the return types you can already declare in M2, f Type := ReturnType => x -> …. If it can work one out, the server offers to add it for you.