i need a example how to use hsc2hs, i thought that when i write a header file like:
// foo.h
#define PI 3.14159
typedef struct {
int i1;
int i2;
} foo;
struct foo2 {
int i1;
int i2;
};
int fooFkt(foo f);
and then create a hsc file like:
import Foreign
import Foreign.C
#include "foo.h"
use hsc2hs
:
{-# INCLUDE "foo.h" #-}
{-# LINE 1 "test.hsc" #-}
import Foreign
{-# LINE 2 "test.hsc" #-}
import Foreign.C
{-# LINE 5 "test.hsc" #-}
i dont understand it, i thought hat hsc2hs will import all needed things for me like the PI
who can give me a better example?
See Question&Answers more detail:os