Apologies, a line from the cut-down example went missing. It should read:

local
  datatype THEOREM = D of (int * int);
in
  type THEOREM = THEOREM;
  exception NOT_ALLOWED;
  infix D;
  fun axiom m = if m <> 0 then m D m else raise NOT_ALLOWED;
end;

> On 31 Oct 2024, at 21:42, Rob Arthan <[email protected]> wrote:
> 
> Dear All,
> 
> I am trying re-use some demo code that I wrote some years ago and am getting 
> different output from what I previously got. 
> 
> A cut-down version of the code is as follows:
> 
> local
>  datatype THEOREM = D of (int * int);
> in
>  type THEOREM = THEOREM;
>  infix D;
>  fun axiom m = if m <> 0 then m D m else raise NOT_ALLOWED;
> end;
> axiom 1;
> 
> The output I used to get was:
> 
> infix 0 D
> eqtype THEOREM
> val axiom = fn: int -> THEOREM
> val it = 1 D 1: THEOREM
> 
> The output I now get is:
> 
> infix 0 D
> eqtype THEOREM
> val axiom = fn: int -> THEOREM
> val it = D (1, 1): THEOREM
> 
> Can I do something to persuade the pretty-printer to use infix notation for 
> the constructor D?
> (In a real application, I would install my own pretty-printer for the type 
> THEOREM, but that
> would be an annoying distraction in the talk that the demo code accompanies.)
> 
> Regards,
> 
> Rob.
> 
> 
> _______________________________________________
> polyml mailing list
> [email protected]
> http://lists.inf.ed.ac.uk/mailman/listinfo/polyml

_______________________________________________
polyml mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml

Reply via email to