You need to code which constructor you used to somehow create an instance of the type.
You can, for example, add a byte that indicates the index of the constructor used. This means that the above values ββcan be saved as follows:
Haskell Binary
I 3 -> 00 00 00 00 03
S 4 -> 01 00 04 XX XX
^ Data
^ Constructor index
XX = unused byte
, , , , , , ( ) .