One of the most powerful features of FP in physics is . By using dimensional analysis within the type system, we can prevent "unit errors" at compile time. For example, a compiler can be configured to throw an error if a student attempts to add a Mass type to a Length type.

A physical state (position, velocity) can be defined as a immutable record. Laws as Functions: Newton’s Second Law (

Learn Physics with Functional Programming: A Haskell-Based Approach