dagit / freetype2

My personal branch of the freetype2 source code
http://freetype.sourceforge.net/index2.html
Other
16 stars 12 forks source link

How deeply to embed C types for freetype #2

Closed dagit closed 13 years ago

dagit commented 13 years ago

Figure out how deeply to embed the C structs/types into Haskell. My initial attempt at the api ended up with way too many structs on the Haskell side, but this may be unavoidable.

If we need this many structs, we should probably split things into more modules/hsc files.

dagit commented 13 years ago

I talked this over with my co-workers and here is my plan:

Only embed the parts of structs that are needed on the Haskell side. By "needed" I mean, things that will be manipulated from the Haskell side.

This "lazy" approach has these benefits:

In the storable instances, we can just use a (#size ...) to allocate space for fields we don't need and then they end up being treated as opaque bytes.