Haskell High Performance Programming.
Boost the performance of your Haskell applications using optimization, concurrency, and parallel programmingAbout This Book Explore the benefits of lazy evaluation, compiler features, and tools and libraries designed for high performance Write fast programs at extremely high levels of abstraction Wo...
Saved in:
Online Access: |
Full Text (via ProQuest) |
---|---|
Main Author: | |
Format: | eBook |
Language: | English |
Published: |
Packt Publishing,
2016.
|
Edition: | 1. |
Subjects: |
Table of Contents:
- Cover; Copyright; Credits; About the Author; About the Reviewer; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Identifying Bottlenecks; Meeting lazy evaluation; Writing sum correctly; Weak head normal form; Folding correctly; Memoization and CAFs; Constant applicative form; Recursion and accumulators; The worker/wrapper idiom; Guarded recursion; Accumulator parameters; Inspecting time and space usage; Increasing sharing and minimizing allocation; Compiler code optimizations; Inlining and stream fusion; Polymorphism performance; Partial functions; Summary.
- Chapter 2: Choosing the Correct Data StructuresAnnotating strictness and unpacking datatype fields; Unbox with UNPACK; Using anonymous tuples; Performance of GADTs and branching; Handling numerical data; Handling binary and textual data; Representing bit arrays; Handling bytes and blobs of bytes; Working with characters and strings; Using the text library; Builders for iterative construction; Builders for strings; Handling sequential data; Using difference lists; Difference list performance; Difference list with the writer monad; Using zippers; Accessing both ends fast with Seq.
- Handling tabular dataUsing the vector package; Handling sparse data; Using the containers package; Using the unordered-containers package; Ephemeral data structures; Mutable references are slow; Using mutable arrays; Using mutable vectors; Bubble sort with vectors; Working with monads and monad stacks; The list monad and its transformer; Free monads; Working with monad transformers; Speedup via continuation-passing style; Summary; Chapter 3: Profile and Benchmark to Your Heart's Content; Profiling time and allocations; Setting cost centres manually; Setting cost centres automatically.
- Installing libraries with profilingDebugging unexpected crashes with profiler; Heap profiling; Cost centre-based heap profiling; Objects outside the heap; Retainer profiling; Biographical profiling; Benchmarking using the criterion library; Profile and monitor in real time; Monitoring over HTTP with ekg; Summary; Chapter 4: The Devil's in the Detail; The anatomy of a Haskell project; Useful fields and flags in cabal files; Test suites and benchmarks; Using the stack tool; Multi-package projects; Erroring and handling exceptions; Handling synchronous errors; The exception hierarchy.
- Handling asynchronous errorsThrow and catch in other monads besides IO; Writing tests for Haskell; Property checks; Unit testing with HUnit; Test frameworks; Trivia at term-level; Coding in GHC PrimOps; Control inlining; Using rewrite rules; Specializing definitions; Phase control; Trivia at type-level; Phantom types; Functional dependencies; Type families and associated types; Useful GHC extensions; Monomorphism Restriction; Extensions for patterns and guards; Strict-by-default Haskell; Summary; Chapter 5: Parallelize for Performance; Primitive parallelism and the runtime system; Spark away.
- Subtle evaluation
- pseq.