<div dir="ltr">Ok, thank you!<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 19, 2020 at 9:44 PM Zoltan Somogyi <<a href="mailto:zoltan.somogyi@runbox.com">zoltan.somogyi@runbox.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
2020-07-20 14:37 GMT+10:00 "Ace" <<a href="mailto:sheganinans@gmail.com" target="_blank">sheganinans@gmail.com</a>>:<br>
> So say I have some enum:<br>
> <br>
> `:- type ex ---> a; b; c.`<br>
> <br>
> And I want to generate a function similar to:<br>
> <br>
> ```<br>
> :- pred ex_mul(ex::out) is multi.<br>
> ex_mul(a).<br>
> ex_mul(b).<br>
> ex_mul(c).<br>
> ```<br>
> <br>
> Any kind of standard library predicate I can use so I don't have to add a<br>
> new case to the predicate for every instance of the enum?<br>
<br>
No, there is no such library predicate.<br>
<br>
If updating the predicate manually becomes too much of a bother,<br>
you could write a script (in sh, python, perl or something else) that<br>
generates the definition of both the type and the predicate from<br>
a single authoritative source in another file.<br>
<br>
Zoltan.</blockquote></div>