我试图x在列表中找到score x具有最大值的列表.我试过snd (maximum [(score x, x) | x <- codes])哪个有效,但我想知道是否有更快的方法来做到这一点,而不是实际存储函数和值.
x
score x
snd (maximum [(score x, x) | x <- codes])
search haskell max
haskell ×1
max ×1
search ×1