[Haskell] How to make sure that a function is evaluated only once?