How to convert a Integer to a ByteString in Haskell

前端 未结 3 594
没有蜡笔的小新
没有蜡笔的小新 2020-12-30 04:09

We\'d like to serialize data in a specific binary format. We use Data.ByteStrings internally.

So, the question is: How to convert the different data typ

3条回答
  •  情话喂你
    2020-12-30 05:05

    Have a look at the binary package, or any of its non-lazy variants: cereal or binary-strict .

    In all three cases, since you have a specific binary format, I'd ignore the type class Binary defined in each, and instead focus on the Put and Get monads they define.

提交回复
热议问题