Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Haskell High Performance Programming

You're reading from   Haskell High Performance Programming Write Haskell programs that are robust and fast enough to stand up to the needs of today

Arrow left icon
Product type Paperback
Published in Sep 2016
Publisher Packt
ISBN-13 9781786464217
Length 408 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
 Thomasson Thomasson
Author Profile Icon Thomasson
Thomasson
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Haskell High Performance Programming
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Identifying Bottlenecks FREE CHAPTER 2. Choosing the Correct Data Structures 3. Profile and Benchmark to Your Heart's Content 4. The Devil's in the Detail 5. Parallelize for Performance 6. I/O and Streaming 7. Concurrency and Performance 8. Tweaking the Compiler and Runtime System (GHC) 9. GHC Internals and Code Generation 10. Foreign Function Interface 11. Programming for the GPU with Accelerate 12. Scaling to the Cloud with Cloud Haskell 13. Functional Reactive Programming 14. Library Recommendations Index

Encoding and serialization


It's an extremely common need to convert data from one format to another. In Haskell, we often like working with Haskell values, because of guarantees of strong-typing and the expressivity of algebraic datatypes, though data must then be converted to and from Haskell values. Conversions should also be fast, because there could be a lot of data.

There are a lot of data formats for different use cases: binary serialization to disk for local storage, efficiently packed formats for transmission over network and formats for interfacing with other applications, even users, in APIs and the like. Next, we'll glance at some of the widely used binary and text serialization libraries.

Binary serialization of Haskell values

The libraries in this subsection are as follows:

  • binary, cereal: Serialization using lazy ByteStrings using automatic or custom binary formats

  • store: An even more direct and efficient serialization library from FPComplete

Efficiently serializing Haskell values...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images