<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"> </span>=> sel<span style="white-space:pre">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>