The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

mickeyvip (17) [Avatar] Offline
#1
Thank you so much for the book!

I have a question about listing 2.9, where we have converted anonymous function to the curried one:

(List.map (viewThumbnail model.selectedUrl) model.photos)


To the best of my understanding we are re-creating the same curried function on each list iteration, which, if it is the case, seems like a waste and performance issue for large lists. We could have created this curried function once in let block and re-use it in the List.map.


Is Elm doing some optimization in similar situations or do we have to handle the optimization ourselves?

Thank you.
mickeyvip (17) [Avatar] Offline
#2
After some thought I think I was wrong and the curried function is indeed created only once.