Model a Trading Order Book with Algebraic Data Types in Haskell
Overview
What this challenge is about.
Design ADTs for Side (Buy | Sell), OrderType (Limit | Market | StopLimit), Order, Trade, and BookState. Make illegal states unrepresentable (e.g. a Match can never produce a negative quantity). Implement place, cancel, modify, match operations as pure functions over BookState. Validate invariants (price-time priority, conservation of quantity, no self-trade) via QuickCheck (or Hedgehog) property tests with 10,000 cases each. Deliver Haskell library code, property-test suite, and an 8-page tutorial writeup explaining the type-driven design decisions.
The Brief
What you'll do, and what you'll demonstrate.
Implement a price-time-priority limit order book in idiomatic Haskell with ADTs that make illegal states unrepresentable, validated by property-based tests.
Earning criteria — what you'll demonstrate
- Apply algebraic data types to model a real financial domain
- Use the type system to make illegal states unrepresentable
- Apply property-based testing to invariant validation
- Write idiomatic Haskell that a senior reviewer will accept
Program Fit
Where this fits in your program.
Sharpens the same skills your degree expects you to demonstrate.
Skills
Skills you'll demonstrate.
Each one shows up on your verified credential.
Careers
Roles this prepares you for.
Real titles. Real skill bridges. Pick the one closest to your trajectory.
Career mappings coming soon.