Synext.PRINTING_STATEAbstract definition for the pretty-printing state.
include Support.Format_state.S with type state := stateinclude Support.Imperative_state.IMPERATIVE_STATE with type state := stateval traverse_list :
state ->
(state -> 'a -> 'b) ->
'a Support.List.t ->
'b Support.List.ttraverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.
val traverse_list1 :
state ->
(state -> 'a -> 'b) ->
'a Support.List1.t ->
'b Support.List1.tval traverse_list2 :
state ->
(state -> 'a -> 'b) ->
'a Support.List2.t ->
'b Support.List2.tval iter_list :
state ->
(state -> 'a -> Stdlib.Unit.t) ->
'a Support.List.t ->
Stdlib.Unit.titer_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.
val iter_list1 :
state ->
(state -> 'a -> Stdlib.Unit.t) ->
'a Support.List1.t ->
Stdlib.Unit.tval iter_list2 :
state ->
(state -> 'a -> Stdlib.Unit.t) ->
'a Support.List2.t ->
Stdlib.Unit.tval traverse_reverse_list :
state ->
(state -> 'a -> 'b) ->
'a Support.List.t ->
'b Support.List.ttraverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.
val traverse_reverse_list1 :
state ->
(state -> 'a -> 'b) ->
'a Support.List1.t ->
'b Support.List1.tval traverse_reverse_list2 :
state ->
(state -> 'a -> 'b) ->
'a Support.List2.t ->
'b Support.List2.tval iter_rev_list :
state ->
(state -> 'a -> Stdlib.Unit.t) ->
'a Support.List.t ->
Stdlib.Unit.titer_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.
val iter_rev_list1 :
state ->
(state -> 'a -> Stdlib.Unit.t) ->
'a Support.List1.t ->
Stdlib.Unit.tval iter_rev_list2 :
state ->
(state -> 'a -> Stdlib.Unit.t) ->
'a Support.List2.t ->
Stdlib.Unit.tval traverse_option :
state ->
(state -> 'a -> 'b) ->
'a Support.Option.t ->
'b Support.Option.tval iter_option :
state ->
(state -> 'a -> Stdlib.Unit.t) ->
'a Support.Option.t ->
Stdlib.Unit.tval seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.tval seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.tval iter_seq :
state ->
(state -> Stdlib.Unit.t) Support.List.t ->
Stdlib.Unit.tval pp_flush : state -> Stdlib.Unit.tpp_flush state is analogous to Format.pp_print_flush.
val pp_newline : state -> Stdlib.Unit.tpp_newline state is analogous to Format.pp_print_newline.
val pp_nop : state -> Stdlib.Unit.tpp_nop state is (). This is useful to signal that nothing should be printed for some execution branch.
val pp_cut : state -> Stdlib.Unit.tpp_cut state is analogous to Format.pp_print_cut.
val pp_space : state -> Stdlib.Unit.tpp_space state is analogous to Format.pp_print_space. Note that this is a possibly breaking space, meaning that a newline may be printed at this point.
val pp_non_breaking_space : state -> Stdlib.Unit.tpp_non_breaking_space state pretty-prints a non-breaking space, meaning that the printer does not insert break directives to that space.
val pp_break : state -> Support.Int.t -> Support.Int.t -> Stdlib.Unit.tpp_break state width offset is analogous to Format.pp_print_break.
val pp_as : state -> Support.Int.t -> Support.String.t -> Stdlib.Unit.tpp_as state size is analogous to Format.pp_print_as to pretty-print a string as if it were of length size. This is useful to pretty-print UTF-8 encoded strings of known codepoint count, or to print a string as if it isn't there, like for HTML tags or ASCII escape sequences.
val pp_box :
state ->
?indent:Support.Int.t ->
(state -> Stdlib.Unit.t) ->
Stdlib.Unit.tpp_box state ?(indent = 0) f evaluates f state in a compacting pretty-printing box wth offset indent in the formatter (see Format.pp_open_box). The box is opened before f state, and closed afterwards.
pp_hbox state f evaluates f state in a horizontal pretty-printing box (see Format.pp_open_hbox). The box is opened before f state, and closed afterwards.
val pp_vbox :
state ->
?indent:Support.Int.t ->
(state -> Stdlib.Unit.t) ->
Stdlib.Unit.tpp_vbox state ?(indent = 0) f evaluates f state in a vertical pretty-printing box with offset indent (see Format.pp_open_vbox). The box is opened before f state, and closed afterwards.
val pp_hvbox :
state ->
?indent:Support.Int.t ->
(state -> Stdlib.Unit.t) ->
Stdlib.Unit.tval pp_hovbox :
state ->
?indent:Support.Int.t ->
(state -> Stdlib.Unit.t) ->
Stdlib.Unit.tval pp_bool : state -> Stdlib.Bool.t -> Stdlib.Unit.tval pp_int : state -> Support.Int.t -> Stdlib.Unit.tval pp_float : state -> Stdlib.Float.t -> Stdlib.Unit.tval pp_char : state -> Stdlib.Char.t -> Stdlib.Unit.tval pp_string : state -> Support.String.t -> Stdlib.Unit.tval pp_option :
state ->
?none:(state -> Stdlib.Unit.t) ->
(state -> 'a -> Stdlib.Unit.t) ->
'a Support.Option.t ->
Stdlib.Unit.tval pp_list :
state ->
?sep:(state -> Stdlib.Unit.t) ->
(state -> 'a -> Stdlib.Unit.t) ->
'a Support.List.t ->
Stdlib.Unit.tval pp_list1 :
state ->
?sep:(state -> Stdlib.Unit.t) ->
(state -> 'a -> Stdlib.Unit.t) ->
'a Support.List1.t ->
Stdlib.Unit.tval pp_list2 :
state ->
?sep:(state -> Stdlib.Unit.t) ->
(state -> 'a -> Stdlib.Unit.t) ->
'a Support.List2.t ->
Stdlib.Unit.tval pp_text : state -> Support.String.t -> Stdlib.Unit.tval pp_utf_8 : state -> Support.String.t -> Stdlib.Unit.tval pp_utf_8_text : state -> Support.String.t -> Stdlib.Unit.tval add_module :
state ->
?location:Syncom.Location.t ->
Syncom.Identifier.t ->
(state -> 'a) ->
'aadd_module state identifier f is the result of f when run in a state in a new module with identifier. Bindings added by f are added to the new module only. The resultant state has identifier bound to the newly created module.
val open_module : state -> Syncom.Qualified_identifier.t -> Stdlib.Unit.topen_module state module_identifier adds the bindings in the module having identifier module_identifier in state.
If module_identifier is unbound in state, then an exception is raised.
val add_abbreviation :
state ->
Syncom.Qualified_identifier.t ->
Syncom.Identifier.t ->
Stdlib.Unit.tadd_abbreviation state module_identifier abbreviation adds abbreviation for referring to the module module_identifier in state.
If module_identifier is unbound in state, then an exception is raised.
val set_default_associativity :
state ->
Syncom.Associativity.t ->
Stdlib.Unit.tset_default_associativity state associativity sets associativity as the default associativity for new user-defined infix operators.
val get_default_associativity : state -> Syncom.Associativity.tget_default_associativity state is the default associativity for new user-defined infix operators.
val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.tset_default_precedence state precedence sets precedence as the default precedence for new user-defined operators.
val get_default_precedence : state -> Support.Int.tget_default_precedence state is the default precedence for new user-defined operators.
val add_lf_type_constant :
state ->
?location:Syncom.Location.t ->
Syncom.Identifier.t ->
Stdlib.Unit.tval add_lf_term_constant :
state ->
?location:Syncom.Location.t ->
Syncom.Identifier.t ->
Stdlib.Unit.tval add_schema_constant :
state ->
?location:Syncom.Location.t ->
Syncom.Identifier.t ->
Stdlib.Unit.tval add_inductive_computation_type_constant :
state ->
?location:Syncom.Location.t ->
Syncom.Identifier.t ->
Stdlib.Unit.tval add_stratified_computation_type_constant :
state ->
?location:Syncom.Location.t ->
Syncom.Identifier.t ->
Stdlib.Unit.tval add_coinductive_computation_type_constant :
state ->
?location:Syncom.Location.t ->
Syncom.Identifier.t ->
Stdlib.Unit.tval add_abbreviation_computation_type_constant :
state ->
?location:Syncom.Location.t ->
Syncom.Identifier.t ->
Stdlib.Unit.tval add_computation_term_constructor :
state ->
?location:Syncom.Location.t ->
Syncom.Identifier.t ->
Stdlib.Unit.tval add_computation_term_destructor :
state ->
?location:Syncom.Location.t ->
Syncom.Identifier.t ->
Stdlib.Unit.tval add_program_constant :
state ->
?location:Syncom.Location.t ->
Syncom.Identifier.t ->
Stdlib.Unit.tval add_prefix_notation :
state ->
?precedence:Support.Int.t ->
Syncom.Qualified_identifier.t ->
Stdlib.Unit.tadd_prefix_notation state ?precedence constant sets constant as a prefix operator with precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.
If constant is unbound in state, then an exception is raised.
val add_infix_notation :
state ->
?precedence:Support.Int.t ->
?associativity:Syncom.Associativity.t ->
Syncom.Qualified_identifier.t ->
Stdlib.Unit.tadd_infix_notation state ?precedence ?associativity constant sets constant as an infix operator with:
p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.a if associativity = Option.Some a, or state's default associativity if associativity = Option.None.If constant is unbound in state, then an exception is raised.
val add_postfix_notation :
state ->
?precedence:Support.Int.t ->
Syncom.Qualified_identifier.t ->
Stdlib.Unit.tadd_postfix_notation state ?precedence constant sets constant as a postfix operator with precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.
If constant is unbound, then an exception is raised.
val add_postponed_prefix_notation :
state ->
?precedence:Support.Int.t ->
Syncom.Qualified_identifier.t ->
Stdlib.Unit.tadd_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.
This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.
val add_postponed_infix_notation :
state ->
?precedence:Support.Int.t ->
?associativity:Syncom.Associativity.t ->
Syncom.Qualified_identifier.t ->
Stdlib.Unit.tadd_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.
This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.
val add_postponed_postfix_notation :
state ->
?precedence:Support.Int.t ->
Syncom.Qualified_identifier.t ->
Stdlib.Unit.tadd_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.
This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.
val apply_postponed_fixity_pragmas : state -> unitapply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.
val lookup_operator :
state ->
Syncom.Qualified_identifier.t ->
Syncom.Operator.t Support.Option.tlookup_operator state constant is the operator description corresponding to constant bound in state.
If constant is unbound in state, then an exception is raised.
val lookup_operator_precedence :
state ->
Syncom.Qualified_identifier.t ->
Support.Int.t Support.Option.t