structs-0.1.3: Strict GC'd imperative object-oriented programming with cheap pointers.

Safe HaskellNone
LanguageHaskell2010

Data.Struct.TH

Synopsis

Documentation

makeStruct :: DecsQ -> DecsQ Source #

Generate allocators, slots, fields, unboxed fields, Eq instances, and Struct instances for the given "data types".

Inputs are expected to be "data types" parameterized by a state type. Strict fields are considered to be slots, Non-strict fields are considered to be boxed types, Unpacked fields are considered to be unboxed primitives.

The data type should use record syntax and have a single constructor. The field names will be used to generate slot, field, and unboxedField values of the same name.

An allocator for the struct is generated by prefixing "alloc" to the data type name.