This is interesting, >From what I can see, you can automatically mashall haskell datatypes into C structs.
Are there portable libraries that do that ? Or do you do this by yourself ? 2011/7/1 Phyx <[email protected]> > What is it? > ======== > > A preprocessor and library which allow you to create dynamic libs > from arbitrary annotated Haskell programs with one click. It also > allows you to use the generated lib in C, C++ and C# just by including > the generated header files. > > At a minimum it can be considered the inverse of c2hs. > > Where to get it? > ============ > > You can get it from Hackage > (http://hackage.haskell.org/package/Hs2lib) or by using cabal > (cabal install Hs2lib). > > Documentation, Mailing List, Source, etc > ======================= > > Go to http://mistuke.wordpress.com/category/hs2lib/ for information. > > What's New? > ========= > > - Currently Supported: > > * Generates Marshaling information for arbitrary data types. > Types with kind other then * have to be fully applied. (e.g. Maybe > String). > A specialized Marshaling instance is then generated for each of > these instances. > * Generates FFI exports for any function you mark, with FFI compatible type > * Properly supports marshaling of lists. [Int] > * Supports Ptr, FunPtr and StablePtr. Which introduces the possibility > to have caches/sessions. > * Supports Callbacks via Higher order functions (everything is auto > generated from the function type) > * Re-exports existing exports found in source file > * Honors existing Storable instances found for types it needs > * Avoids unsafePerformIO as much as possible, except for in one > specific instance. > * Generates Initialization functions for you > * Hides unnecessary exports using a DEF file > * Allows you to override default type conversions (e.g. String –> CWString) > * Provides helper includes for C, C++ and C# (placed into wherever > cabal places extra includes. %AppData%\cabal\Hs2lib-0.4.8 for windows) > And more > > Details > ===== > > A more detailed documentation will follow in the next few weeks. > > Why 0.4.8? > -------------- > > This project has been in development for a very long time. Nearly two > years on and off. > It was developed mainly to facilitate the creation of Visual Haskell > 2010. This is just the first public > release of this tool. > > _______________________________________________ > Haskell-Cafe mailing list > [email protected] > http://www.haskell.org/mailman/listinfo/haskell-cafe >
_______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
