<div dir="ltr"><div><div><div><div><div><div><div><div><div>Dear Haskelleers,<br><br></div>I suspect my problem has been discussed many times and under many forms, so please don&#39;t shoot me for asking. I could not find an acceptable solution yet, and beeing as stubborn as i am, I still hope the solution is eluding me because of my poor haskell knowlegde. So here I am posting my question on this mailing list.<br>
<br></div>Basically I am trying to GUI Widgets using haskell types (Buttons, Textfields, etc.).<br></div>1/ Using Records is not acceptable because of the name clashes between attribute names. I could use prefixes and write functions in typeclasses for accessor, but it&#39;s ugly and a lot of work. <br>
<br></div>2/ I decided to keep the attributes in Maps, so basically a textfield would be<br><br>data Textfield = Textfield (Map.Map TextfieldProps String)<br><br></div>The problem is: how to define TextfieldProps? It should be something like:<br>
<br></div>data TextfieldProps = Id | Label | Value<br><br></div>But then, buttons also have Id&#39;s and labels. So following is not accepted anymore:<br><br></div>data ButtonProps = Id | Label | OnClick<br><br></div>Ideas and suggestions are much appreciated. Thank You,<br>
Răzvan<br></div>