← Graph

Calculation

concept 3 connections

Wójtowicz/Normand's second FP category: a function whose output depends only on its input and nothing else. You can run it once or a million times and always get the same result (modulo Ruby allowing someone to monkey-patch behavior). The Enigma machine is a real-world example: given an encrypted message and settings, decryption is deterministic. Whether something is a calculation can depend on context — a sales_tax argument that is a method parameter or a fixed configuration preserves calculation status, but an instance variable or 'current user's geo sales tax' turns it into an action. Composition: data + calculation = calculation.

category
concept
about
Calculation concept
Second of the three categories to identify.
about
Calculation concept
Second of the three core FP terms defined in the talk.
concept Action
related_to
Calculation concept
Composition rule: an action propagates action-ness through the call graph, turning neighbouring calculations into actions.

Provenance

Read by
1 extraction