<div>In any case, what I want to do is store FunPtr in&nbsp; a data type and marshall into a C struct as a C function pointer. </div>
<div>&nbsp;</div>
<div>Vasili<br><br></div>
<div class="gmail_quote">On Mon, Jun 9, 2008 at 1:24 AM, Galchin, Vasili &lt;<a href="mailto:vigalchin@gmail.com">vigalchin@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Thanks. Clause?<br><br>regards, Vasili 
<div>
<div></div>
<div class="Wj3C7c"><br><br>
<div class="gmail_quote">On Mon, Jun 9, 2008 at 12:54 AM, Bulat Ziganshin &lt;<a href="mailto:bulat.ziganshin@gmail.com" target="_blank">bulat.ziganshin@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Hello Vasili,<br><br>Monday, June 9, 2008, 6:17:14 AM, you wrote:<br><br>1. standard place to import FunPtr from is Foreign.Ptr, not System.Posix<br>
2. FunPtr is exported as abstract type, without constructors. you<br>can&#39;t construct values of this type directly. instead you should use<br>&quot;wrapper&quot; generators as in the example that Clause has wrote. read it<br>
carefully :)<br>
<div>
<div></div>
<div><br><br>&gt; Hello,<br><br>&gt; &nbsp;&nbsp;&nbsp;&nbsp; I am getting what is to me a mysterious error in a test case that I am writing:<br>&gt; vigalchin@ubuntu:~/FTP/Haskell/unix-2.2.0.0/tests/timer$ runhaskell Setup.lhs build<br>&gt; Preprocessing executables for Test-1.0...<br>
&gt; &nbsp;Building Test-1.0...<br>&gt; [1 of 1] Compiling Main&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( ./timer.hs,<br>&gt; dist/build/timer/timer-tmp/Main.o )<br><br>&gt; ./timer.hs:11:45: Not in scope: data constructor `FunPtr&#39;<br><br>&gt; It seems like the compiler is complaining about the lack of FunPtr<br>
&gt; in it&#39;s symbol table but System.Posix is imported:<br>&gt;<br>&gt; module Main where<br><br>&gt; import System.Posix<br>&gt; import Foreign<br>&gt; import Foreign.C<br>&gt; import Foreign.Ptr<br><br>&gt; main = do<br>
<br>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; let event = Sigevent{sigevFunction=(FunPtr (notifyFunc))}&nbsp; &lt;&lt;&lt;&lt;&lt;&lt; error here<br>&gt;<br>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; timerId &lt;- timerCreate Clock_Realtime Nothing<br><br>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; timerDelete timerId<br>
<br>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return ()<br><br>&gt; notifyFunc :: Sigval -&gt; IO ()<br>&gt; notifyFunc sigval = do<br>&gt; &nbsp;&nbsp; putStrLn &quot;timer POP!!!!!!!&quot;<br>&gt; &nbsp;&nbsp;&nbsp; return ()<br><br>&gt; I am probably looking right at the answer and not seeing it. ??<br>
<br>&gt; Thanks, Vasili<br><br><br><br>&gt;<br><br><br></div></div><font color="#888888">--<br>Best regards,<br>&nbsp;Bulat &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mailto:<a href="mailto:Bulat.Ziganshin@gmail.com" target="_blank">Bulat.Ziganshin@gmail.com</a><br>
<br></font></blockquote></div><br></div></div></blockquote></div><br>