<html><head></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div>Hi, Sean!</div><div><br></div><div>This is from your ANSI module:</div><pre><br></pre><pre>:- type aio_state</pre><pre>    --->    aio_state(</pre><pre>                f_colour :: bool,    % Colour or monochrome output?</pre><pre>                f_quiet  :: bool     % All output suppressed?</pre><pre>            ).</pre><pre><br></pre><pre>:- mutable(astate, aio_state, aio_state(yes, no), ground, [untrailed]).</pre><div><br></div><pre>% ...</pre><pre><br></pre><pre>:- pragma promise_pure(enable_colours/1).</pre><pre><br></pre><pre>enable_colours(Mode) :-</pre><pre>    semipure get_astate(aio_state(_, Quiet)),</pre><pre>    impure set_astate(aio_state(Mode, Quiet)).</pre><pre><br></pre><pre><br></pre><div>I'm wondering why you aren't using "attach_to_io_state" and don't make enable_colours an IO action. You're using the impure get_astate/set_astate instead. I don't fully comprehend the implications, but this should probably be avoided.</div><div><br></div><div>Cheers,</div><div>Volker</div><div><br></div><div><br></div><div>Am Samstag, dem 24.08.2024 um 10:38 +0100 schrieb Sean Charles (emacstheviking):</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div>I finally made it a library and decided to share it.</div><div>It's probably not 100% efficient but then neither am I, but it works and does what I need.</div><div><br><div><br></div><div><div style="display: block;"><div style="-webkit-user-select: all; -webkit-user-drag: element; display: inline-block;" class="apple-rich-link" draggable="true" role="link" data-url="https://github.com/emacstheviking/mercury-libaio"><a style="border-radius:10px;font-family:-apple-system, Helvetica, Arial, sans-serif;display:block;-webkit-user-select:none;width:300px;user-select:none;-webkit-user-modify:read-only;user-modify:read-only;overflow:hidden;text-decoration:none;" class="lp-rich-link" rel="nofollow" href="https://github.com/emacstheviking/mercury-libaio" dir="ltr" role="button" draggable="false" width="300"><table style="table-layout:fixed;border-collapse:collapse;width:300px;background-color:#E5E6E9;font-family:-apple-system, Helvetica, Arial, sans-serif;" class="lp-rich-link-emailBaseTable" cellpadding="0" cellspacing="0" border="0" width="300"><tbody><tr><td vertical-align="center" align="center"><img style="width:300px;filter:brightness(0.97);height:150px;" width="300" height="150" draggable="false" class="lp-rich-link-mediaImage" alt="mercury-libaio.png" src="cid:B8B6C3D0-E5B9-449D-9A05-CFEBBF9F9BB7"></td></tr><tr><td vertical-align="center"><table bgcolor="#E5E6E9" cellpadding="0" cellspacing="0" width="300" style="font-family:-apple-system, Helvetica, Arial, sans-serif;table-layout:fixed;background-color:rgba(229, 230, 233, 1);" class="lp-rich-link-captionBar"><tbody><tr><td style="padding:8px 0px 8px 0px;" class="lp-rich-link-captionBar-textStackItem"><div style="max-width:100%;margin:0px 16px 0px 16px;overflow:hidden;" class="lp-rich-link-captionBar-textStack"><div style="word-wrap:break-word;font-weight:500;font-size:12px;overflow:hidden;text-overflow:ellipsis;text-align:left;" class="lp-rich-link-captionBar-textStack-topCaption-leading"><a rel="nofollow" href="https://github.com/emacstheviking/mercury-libaio" style="text-decoration: none" draggable="false"><font color="#272727" style="color: rgba(0, 0, 0, 0.847059);">emacstheviking/mercury-libaio: Simple ANSI support for terminal based applications.</font></a></div><div style="word-wrap:break-word;font-weight:400;font-size:11px;overflow:hidden;text-overflow:ellipsis;text-align:left;" class="lp-rich-link-captionBar-textStack-bottomCaption-leading"><a rel="nofollow" href="https://github.com/emacstheviking/mercury-libaio" style="text-decoration: none" draggable="false"><font color="#808080" style="color: rgba(0, 0, 0, 0.498039);">github.com</font></a></div></div></td></tr></tbody></table></td></tr></tbody></table></a></div></div><br></div><div><br></div><div>Thanks,</div><div>Sean.</div><div><br></div></div><div>_______________________________________________<br></div><div>users mailing list<br></div><div><a href="mailto:users@lists.mercurylang.org">users@lists.mercurylang.org</a><br></div><div><a href="https://lists.mercurylang.org/listinfo/users">https://lists.mercurylang.org/listinfo/users</a><br></div></blockquote><div><br></div><div><span></span></div></body></html>