|Maintainer||Lars Petersen <email@example.com>|
For any algebraic datatype just make it an instance of class
by simply deriving
Data on definition or try stand-alone-deriving. This
allows the library to enumerate the value constructors and thereby
encoding their index. Notice that serialisation depends on a type's
structure. Serialisations might get unreadable if the type is altered.
putGeneric implement a selection of type-specific
defaults and are grounded by a canonical serialisation for all algebraic
types that instantiate
Have a look at
Data.Binary.Generic.Extensions for details.
If you want to ground your own type-specific stack
myStack of extensions
write the following for the
getMyStack :: Data a => Get a getMyStack = myStack (getGenericByCallback getMyStack)