Least squares fitting with functional programming | Hacker News Reader