<div dir="auto"><div>The meaning of XEvent is different on the left and right sides of the newtype declaration. On the left, it's a type; on the right, it's a data constructor. The constructor wraps a value which refers to the type, but not recursively back to the constructor itself.</div><div dir="auto"><br><div class="gmail_quote" dir="auto"><div dir="ltr">On Tue, Nov 6, 2018, 8:36 AM Guru Devanla <<a href="mailto:gurudev.devanla@gmail.com">gurudev.devanla@gmail.com</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>Hello Haskell-Cafe,</div><div><br></div><div>I have been recently studying the XMonad code and some related types available in the X11 bindings library.</div><div><br></div><div>I came across this type: <br></div><span class="m_6650469407821808840gmail-keyword"><br></span></div><div dir="ltr"><span class="m_6650469407821808840gmail-keyword">newtype</span> <a id="m_6650469407821808840gmail-t:XEvent" class="m_6650469407821808840gmail-def" rel="noreferrer">XEvent = XEvent XEventPtr</a><div><a id="m_6650469407821808840gmail-t:XEvent" class="m_6650469407821808840gmail-def" rel="noreferrer"><br></a></div><div><font size="2"><span class="m_6650469407821808840gmail-keyword">type</span> <a id="m_6650469407821808840gmail-t:XEventPtr" class="m_6650469407821808840gmail-def" rel="noreferrer">XEventPtr</a> = <a href="http://hackage.haskell.org/package/base-4.10.1.0/docs/Foreign-Ptr.html#t:Ptr" target="_blank" rel="noreferrer">Ptr</a> <a href="http://hackage.haskell.org/package/X11-1.9/docs/Graphics-X11-Xlib-Event.html#t:XEvent" target="_blank" rel="noreferrer">XEvent</a></font></div><div><font size="2"><br></font></div><div><font size="2">Available here:  </font><br></div><div><a href="http://hackage.haskell.org/package/X11-1.9/docs/Graphics-X11-Xlib-Event.html#t:XEvent" target="_blank" rel="noreferrer">http://hackage.haskell.org/package/X11-1.9/docs/Graphics-X11-Xlib-Event.html#t:XEvent</a></div><div><font size="2"><br></font></div><div><font size="2">It seems that this type is circular here. how does one use this type? Is it possible to create a value out of this type? What is the use of this type?<br></font></div><div><font size="2"><br></font></div><div><font size="2">Please could someone help me wrap my head around this?<br></font></div><div><font size="2"><br></font></div><div><font size="2">Thanks</font></div><div><font size="2"><br></font></div><div><font size="2"><br></font></div><div><font size="2"><br></font></div><div><br></div><div><br></div><div><br></div></div></div>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div></div></div>