<div dir="ltr">I forgot to mention that I would like it to be user extensible. So I'm now thinking I should just pass in a set and check for membership.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Aug 24, 2013 at 4:09 PM, Chris Moline <span dir="ltr"><<a href="mailto:blackredtree@gmail.com" target="_blank">blackredtree@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi, I'm making a binding to gtk to help me gain some familiarity with the language but I don't know how to reflect type constraints within agda. How can I make "instances" of a type? <div>
<br></div><div>For example, 'actionConnectProxy :: (ActionClass self, WidgetClass proxy)<span style="white-space:pre-wrap"> </span>=> sel<span style="white-space:pre-wrap">f </span>-> proxy -> IO ()'</div>
<div><br>
</div><div>This is easily exported with</div><div><br></div><div><br></div><div><br></div><div>postulate</div><div> actionConnectProxy : {A, B : Set} -> A -> B -> IO Unit</div><div><br></div><div>{-# COMPILED actionConnectProxy Graphics.UI.Gtk.actionConnectProxy #-}</div>
<div><br></div><div><br></div><div><br></div><div>But how do I restrict A to ActionClass and B to WidgetClass? I could go </div><div><br></div><div><br></div><div>postulate WidgetClass : {A : Set} -> A -> A</div><div>
<br></div><div>{-# COMPILED_TYPE WidgetClass (WidgetClass a => a) #-}</div><div><br></div><div><br></div><div><br></div><div><div>But I would like the data type to be somehow restricted to "instances" of the type. Any help would be appreciated.</div>
</div><div><br></div></div>
</blockquote></div><br></div>