<div dir="ltr">Hello, I have an application which could benefit from caching certain computations. For instance, I might have a function:<div><br></div><div>listToWord :: [Int] -> Word16</div><div><br></div><div>which takes an integer X in the input as referring to bit X in the output word, and sets the bits.</div><div><br></div><div>I have to run this computation many times within the inner loop. So I thought I could cache it. The only trouble is that it may not be any less expensive to convert the [Int] into a hash value, or use it as a key to look up a binary Map. </div><div><br></div><div>What do you think? Does Haskell hashing use some kind of optimized computation that's faster than me writing a loop by hand?</div><div><br></div><div>D</div><div><br></div></div>