package mdx

  1. Overview
  2. Docs
Executable code blocks inside markdown files

Install

Dune Dependency

Authors

Maintainers

Sources

mdx-1.8.0.tbz
sha256=a248a58792c132f5b63982148ad85cc1d531a354cbbdd08156e108d5c6b951dc
sha512=1233893859b0f67a43759ec0c1c795dbbffa40555eb37440ea161dc3f773b8724f368d749a05555687244a62af8036a97357bec86376659d70f3d9d4355496e2

doc/mdx.csexp/Csexp/index.html

Module Csexp

Canonical S-expressions

This module provides minimal support for reading and writing S-expressions in canonical form.

https://en.wikipedia.org/wiki/Canonical_S-expressions

Note that because the canonical representation of S-expressions is so simple, this module doesn't go out of his way to provide a fully generic parser and printer and instead just provides a few simple functions. If you are using fancy input sources, simply copy the parser and adapt it. The format is so simple that it's pretty difficult to get it wrong by accident.

To avoid a dependency on a particular S-expression library, the only module of this library is parameterised by the type of S-expressions.

  let rec print = function
    | Atom str -> Printf.printf "%d:%s" (String.length s)
    | List l -> List.iter print l
module type Sexp = sig ... end
module Make (Sexp : Sexp) : sig ... end
OCaml

Innovation. Community. Security.