I think this line should be following.

```scala
val result = Memo.immutableHashMapMemo(a)
```

- `lazy` is unnecessary. the variable `result` is referenced immediately.
- `(t: T) => a(t)` allocate unnecessary `Function1` object.