Deterministic booklet imposition and fold-order verification in pure MoonBit
pub(all) enum Binding { Left Right} derive(Eq, @moonbitlang/core/debug.DebugDebug)
fn Binding::equal(Binding, Binding) -> Bool
fn Binding::not_equal(x : Binding, y : Binding) -> Bool
fn Binding::to_repr(Binding) -> @moonbitlang/core/debug.ReprRepr
pub(all) enum Duplex { LongEdge ShortEdge} derive(Eq, @moonbitlang/core/debug.DebugDebug)
fn Duplex::equal(Duplex, Duplex) -> Bool
fn Duplex::not_equal(x : Duplex, y : Duplex) -> Bool
fn Duplex::to_repr(Duplex) -> @moonbitlang/core/debug.ReprRepr
pub(all) struct Face { left : Slot right : Slot rotation : Int} derive(Eq, @moonbitlang/core/debug.DebugDebug)
fn Face::equal(Face, Face) -> Bool
fn Face::not_equal(x : Face, y : Face) -> Bool
fn Face::to_repr(Face) -> @moonbitlang/core/debug.ReprRepr
pub(all) struct Layout { left : Rect right : Rect} derive(Eq, @moonbitlang/core/debug.DebugDebug)
fn Layout::equal(Layout, Layout) -> Bool
fn Layout::not_equal(x : Layout, y : Layout) -> Bool
fn Layout::to_repr(Layout) -> @moonbitlang/core/debug.ReprRepr
pub(all) struct Paper { width : Int height : Int margin : Int gutter : Int creep : Int} derive(Eq, @moonbitlang/core/debug.DebugDebug)
fn Paper::equal(Paper, Paper) -> Bool
fn Paper::not_equal(x : Paper, y : Paper) -> Bool
fn Paper::to_repr(Paper) -> @moonbitlang/core/debug.ReprRepr
pub(all) struct Plan { page_count : Int signature_pages : Int binding : Binding duplex : Duplex sheets : Array[Sheet]} derive(Eq, @moonbitlang/core/debug.DebugDebug)
fn Plan::equal(Plan, Plan) -> Bool
fn Plan::not_equal(x : Plan, y : Plan) -> Bool
fn Plan::to_repr(Plan) -> @moonbitlang/core/debug.ReprRepr
pub(all) enum PlanError { PageCount SignatureSize Geometry CorruptPlan(String)} derive(Eq, @moonbitlang/core/debug.DebugDebug)
fn PlanError::equal(PlanError, PlanError) -> Bool
fn PlanError::not_equal(x : PlanError, y : PlanError) -> Bool
fn PlanError::to_repr(PlanError) -> @moonbitlang/core/debug.ReprRepr
pub(all) struct Rect { x : Int y : Int width : Int height : Int} derive(Eq, @moonbitlang/core/debug.DebugDebug)
fn Rect::equal(Rect, Rect) -> Bool
fn Rect::not_equal(x : Rect, y : Rect) -> Bool
fn Rect::to_repr(Rect) -> @moonbitlang/core/debug.ReprRepr
pub(all) struct Sheet { signature : Int depth : Int front : Face back : Face} derive(Eq, @moonbitlang/core/debug.DebugDebug)
fn Sheet::equal(Sheet, Sheet) -> Bool
fn Sheet::not_equal(x : Sheet, y : Sheet) -> Bool
fn Sheet::to_repr(Sheet) -> @moonbitlang/core/debug.ReprRepr
pub(all) struct Signature { index : Int start : Int pages : Int real_pages : Int} derive(Eq, @moonbitlang/core/debug.DebugDebug)
fn Signature::equal(Signature, Signature) -> Bool
fn Signature::not_equal(x : Signature, y : Signature) -> Bool
fn Signature::to_repr(Signature) -> @moonbitlang/core/debug.ReprRepr
pub(all) enum Slot { Page(Int) Blank} derive(Eq, @moonbitlang/core/debug.DebugDebug)
fn Slot::equal(Slot, Slot) -> Bool
fn Slot::not_equal(x : Slot, y : Slot) -> Bool
fn Slot::to_repr(Slot) -> @moonbitlang/core/debug.ReprRepr
fn csv_report(plan : Plan) -> Result[String, PlanError]
fn impose(pages : Int, maximum : Int) -> Result[Plan, PlanError]
fn impose_with(pages : Int, maximum : Int, binding : Binding, duplex : Duplex) -> Result[Plan, PlanError]
fn json_report(plan : Plan) -> Result[String, PlanError]
fn layout(paper : Paper, depth : Int) -> Result[Layout, PlanError]
fn recover(plan : Plan) -> Result[Array[Slot], PlanError]
fn signatures(pages : Int, maximum : Int) -> Result[Array[Signature], PlanError]
fn svg_proof(plan : Plan, paper : Paper, sheet_index : Int, back : Bool) -> Result[String, PlanError]
fn validate_config(pages : Int, signature_pages : Int) -> Result[Unit, PlanError]
fn verify(plan : Plan) -> Result[Unit, PlanError]
Install
Powered by MoonBit
© 2026 mooncakes.io