Haskell Optimization Handbook
Table of Contents
indices and tables
Table of Contents
indices and tables
Quick search

Table of Contents

  • Preliminaries
  • Measurement, Profiling, and Observation
  • Optimizations
    • Optimizations
  • Case Studies

indices and tables

  • Glossary
  • Docs »
  • 3. Optimizations
  • ← 2.6.8. Nothunks
  • 3.1. GHC Flags →

3. Optimizations¶

  • 3.1. GHC Flags
    • 3.1.1. GHC Flags
  • 3.2. GHC Optimizations
    • 3.2.1. Defunctionalization
    • 3.2.2. The Static Arguments Transformation
    • 3.2.3. Lambda Lifting
      • 3.2.3.1. A Working Example
      • 3.2.3.2. How Lambda Lifting Works in GHC
      • 3.2.3.3. Observing the Effect of Lambda Lifting
      • 3.2.3.4. When to Manually Lambda Lift
      • 3.2.3.5. Summary
    • 3.2.4. Loopification
    • 3.2.5. Manual Worker/Wrapper
    • 3.2.6. Understanding Demand Analysis
  • 3.3. Library Based Changes
    • 3.3.1. Lower Impedance with Better Data Structures
  • 3.4. Library Agnostic Changes
    • 3.4.1. Ordering Data Constructors
    • 3.4.2. Wrangling Lazy Tuples
    • 3.4.3. Appropriate Folding
    • 3.4.4. Avoid Runtime Checks with Parse Don’t Validate:
    • 3.4.5. Data-Oriented Design
    • 3.4.6. Using GHC.Exts
    • 3.4.7. Inlining Pragma and Friends
    • 3.4.8. Specialization
    • 3.4.9. Fusion and Rules
    • 3.4.10. Unboxing
    • 3.4.11. Unpacked Product Types
    • 3.4.12. Avoiding Nested Monad Transformers
    • 3.4.13. Unroll Monad Transformer Stacks
    • 3.4.14. The OneShot Monad Trick
    • 3.4.15. Continuation Passing Style
    • 3.4.16. Using Levity Polymorphism
    • 3.4.17. Using Backpack to Unroll Data Structures
  • ← 2.6.8. Nothunks
  • 3.1. GHC Flags →
© Copyright 2022-2025, Jeffrey Young (doyougnu).
Created using Sphinx 7.2.6 with Press Theme 0.8.0.