<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I have a type definition like this:</div><div class=""><br class=""></div><div class=""><font face="Courier New" style="font-size: 14px;" class="">:- type tcon<br class=""> ---> tcon(<br class=""> options :: felt_options,<br class=""> output :: list(rop),<br class=""> warnings :: lserror,<br class=""> errors :: lserror,<br class=""><b class=""> render :: pred(instruction::in, string::in, string::out) is semidet<br class=""></b> % ENV[] stack can go in here too<br class=""> ).</font></div><div class=""><br class=""></div><div class="">The `render` field, I wanted to be able to code this something like:</div><div class=""><br class=""></div><div class=""><font face="Courier New" style="font-size: 14px;" class=""> render :: foo</font></div><div class=""><br class=""></div><div class="">where foo would have been defined as</div><div class=""><br class=""></div><div class=""><span style="font-size: 14px;" class=""><font face="Courier New" class="">:- type foo = (<b style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">pred(instruction::in, string::in, string::out) is semidet).</b></font></span></div><b style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><br class=""></b><div class=""><font color="#000000" class="">because I also wanted to be able to declare predicates that take a `foo` but it seems that I can’t do that. I’ve read Chapter 8 — Higher-order programming but I find my lack of familiarity with the terminology once again leaving me stumped.</font></div><div class=""><font color="#000000" class=""><br class=""></font></div><div class=""><font color="#000000" class="">I guess what I am after is something like the classic ‘pointer to a function returning an int’ in C.</font></div><div class=""><font color="#000000" class=""><br class=""></font></div><div class=""><font color="#000000" class="">How would I approach such a thing in Mercury?</font></div><div class=""><font color="#000000" class=""><br class=""></font></div><div class=""><font color="#000000" class="">Thank you,</font></div><div class=""><font color="#000000" class="">Sean</font></div><div class=""><font color="#000000" class=""><br class=""></font></div></body></html>