
13 Dec
2013
13 Dec
'13
11:44 a.m.
On 12/13/2013 05:00 PM, Nikita Karetnikov wrote:
Could anyone explain how to write a Storable instance for MyStruct? (The key field allows to determine the type of a value inside the union.)
You can peek the "key", and then, depending on its value, return a different constructor : data MyStruct = MyStructOne Foo | MyStructFour Integer | MyStructTwenty [Blah]