<div>In any case, what I want to do is store FunPtr in a data type and marshall into a C struct as a C function pointer. </div>
<div> </div>
<div>Vasili<br><br></div>
<div class="gmail_quote">On Mon, Jun 9, 2008 at 1:24 AM, Galchin, Vasili <<a href="mailto:vigalchin@gmail.com">vigalchin@gmail.com</a>> 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 <<a href="mailto:bulat.ziganshin@gmail.com" target="_blank">bulat.ziganshin@gmail.com</a>> 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't construct values of this type directly. instead you should use<br>"wrapper" generators as in the example that Clause has wrote. read it<br>
carefully :)<br>
<div>
<div></div>
<div><br><br>> Hello,<br><br>> I am getting what is to me a mysterious error in a test case that I am writing:<br>> vigalchin@ubuntu:~/FTP/Haskell/unix-2.2.0.0/tests/timer$ runhaskell Setup.lhs build<br>> Preprocessing executables for Test-1.0...<br>
> Building Test-1.0...<br>> [1 of 1] Compiling Main ( ./timer.hs,<br>> dist/build/timer/timer-tmp/Main.o )<br><br>> ./timer.hs:11:45: Not in scope: data constructor `FunPtr'<br><br>> It seems like the compiler is complaining about the lack of FunPtr<br>
> in it's symbol table but System.Posix is imported:<br>><br>> module Main where<br><br>> import System.Posix<br>> import Foreign<br>> import Foreign.C<br>> import Foreign.Ptr<br><br>> main = do<br>
<br>> let event = Sigevent{sigevFunction=(FunPtr (notifyFunc))} <<<<<< error here<br>><br>> timerId <- timerCreate Clock_Realtime Nothing<br><br>> timerDelete timerId<br>
<br>> return ()<br><br>> notifyFunc :: Sigval -> IO ()<br>> notifyFunc sigval = do<br>> putStrLn "timer POP!!!!!!!"<br>> return ()<br><br>> I am probably looking right at the answer and not seeing it. ??<br>
<br>> Thanks, Vasili<br><br><br><br>><br><br><br></div></div><font color="#888888">--<br>Best regards,<br> Bulat 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>