Skip to content

notes on API improvements #32

@c-cube

Description

@c-cube
  • put everything in a single module Nottui (easily aliasable/openable). I'll refer to it as UI from now on.
  • re-export Lwd as UI.Incremental and Lwd_seq as UI.Seq
  • UI.Syntax with let$ and other bind/map from Lwd, along with UI helpers like <|> or <-> for h/v concatenation of UI elements
  • everything returns lwd-wrapped UI elements. I think UI.t = UI.Pure.t Lwd.t would make a lot of sense (where UI.Pure.t can be the base type for non-reactive elements). Most functions will work on lwd-wrapped things.
  • commonly used functionality is re-exported at toplevel in UI, for example UI.s for a string widget, UI.space, UI.sprintf, hcat (list), hjoin (binary horizontal concat), <|> (alias for hcat)
  • widgets can have their own submodule with all the bells and whistles (maybe as objects?), + a toplevel function to build them easily (like UI.Scrollable for the whole thing, along with a UI.scrollable : … function for the common case)
  • re-export pretty as UI.Pretty (can be just a module alias for lightweightness)

minor quibbles

  • flex needs more testing (but would be useful to keep)
  • scrollable currently doesn't take as much space as it can, so only the used part is actually scrollable

also see #5 for a bigger wishlist 🐴 🎅 🎁

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions