Kalman filters and functional programming