open Ui

type t = {Uni : select Length.unit,
          Value : input float}

val ui_t = mkUi {Render = fn t => <xml>{render t.Uni}{render t.Value}</xml>,
                 Value = fn t => uni <- value t.Uni;
                            value <- value t.Value;
                            return (Option.mp (fn value => {Uni = uni, Value = value}) value)}

val create =
    uni <- select Length.allUnits;
    value <- input;
    return {Uni = uni, Value = value}