def print

bend-lint-rules@0.2.0.0 · layout/format.bend:2024

import bend-lint-rules@0.2.0.0/layout/format.bend as Format
import Base

2024# The doc at indent; fuel bounds the steps of the printer and of each fit.
2025# A group is all flat if it fits; else its separators break together.
2026# Nesting is relative, never aligned under a function name. The width is a
2027# target, not a license to split atoms.
2028def print(doc: Doc, width: Maybe<&2, U32>, +indent: U32, newline: String, +fuel: Nat) -> String:
2029  print.go(
2030    fuel,
2031    Print{[Job{doc, indent, False{}}], [], pad(U32.to_nat(indent), ""), indent},
2032    width,
2033    newline,
2034    fuel
2035  )

Uses (12)

Used by (1)