Skip to content

Commit 63101db

Browse files
committed
ref: typo
1 parent 2a44fc5 commit 63101db

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

content/blog/2025-10-26-immutability-in-phel.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ Because `groceries` never changes, any function that already received it can kee
3232
{:id 42 :name "Ada" :email "[email protected]"}]
3333
```
3434

35-
`put` returns a new map that shares everything it can with the original. The copy is cheap thanks to structural sharingPhel only allocates the path that actually changed.
35+
`put` returns a new map that shares everything it can with the original. The copy is cheap thanks to structural sharing, Phel only allocates the path that actually changed.
3636

37-
## Benefits of data that never moves
37+
## Benefits of data that never changes
3838

39-
- **Predictable functions**: When inputs stay frozen, the only way to change results is to change the arguments. That keeps functions referentially transparent and stops ghost bugs.
40-
- **Stress-free tests**: Pure functions are a breeze to unit test—you pass data in, check the value coming out, and never mock hidden state changes.
41-
- **Simpler debugging**: Log a value once and you can trust it forever. Nothing mutates underneath any traces.
42-
- **Effortless concurrency**: Share the same collection between threads or async tasks with zero drama.
39+
- **Predictable functions**: With immutable inputs, the only variable is the arguments themselves. This guarantees referential transparency and eliminates hidden, hard-to-trace bugs.
40+
- **Stress-free tests**: Testing pure functions is effortless, just pass in data, check the result, and forget about mocking or side effects.
41+
- **Simpler debugging**: Log it once, and it stays true, no sneaky mutations hiding under your traces.
42+
- **Effortless concurrency**: Pass the same data between async jobs without race conditions or surprises.
4343

4444
## Transforming data in steps
4545

@@ -62,6 +62,8 @@ The vector `scores` is still the same after the reduction, ready to reuse later.
6262

6363
## Managing change at the edges
6464

65-
Of course, real systems still have to talk to databases, HTTP clients, or the filesystem. Immutability just asks you to fence off those effectful bits. Keep updates at well-defined entry points, translate external state into immutable Phel values, and let the rest of your code cruise on pure data. When you do need a new version, reach for helpers like `put-in`, `unset`, or `push` and pass the result forward.
65+
Real programs still need to talk to the outside world; databases, APIs, the filesystem. Immutability doesn’t stop that; it just asks you to keep those side effects in their own little corner.
6666

67-
Once you stop mutating data in place, your mental load shrinks: there's the value you received, and the value you return. **That's it**. Everything else becomes easier to trust — and that's why, in Phel, your data should never change.
67+
Do your updates at clear entry points, turn any external data into immutable Phel values, and let the rest of your code run safely on pure data. When you need a new version, use helpers like `put-in`, `unset`, or `push`, and pass the new value forward instead of mutating it.
68+
69+
Once you stop changing data in place, life gets simpler: there’s the value you got, and the value you return. **That's it**. Everything else becomes easier to trust, and that’s why, in Phel, your data never changes.

0 commit comments

Comments
 (0)