[Haskell-beginners] ffi array and peekArray

PICCA Frederic-Emmanuel frederic-emmanuel.picca at synchrotron-soleil.fr
Sun Nov 8 20:30:13 UTC 2015


Ok, so now I get this error 


ghkl.hs:20:18:
    No instance for (Foreign.Storable.Storable HklFactory)
      arising from a use of ‘peekArray’
    In a stmt of a 'do' block: peekArray n factories
    In the expression:
      do { factories <- c_hkl_factory_get_all ptr;
           n <- peek ptr;
           peekArray n factories }
    In the second argument of ‘($)’, namely
      ‘\ ptr
         -> do { factories <- c_hkl_factory_get_all ptr;
                 n <- peek ptr;
                 .... }’


What should I do to create a Storable for HklFactory which is a simple pointer.

Thanks

Frederic


More information about the Beginners mailing list