Example Haskell code that updates computed values