I have a function in Haskell which finds the maximum value of an exponentiation from a list:
prob99 = maximum $ map (\\xs -> (head xs)^(head (tail xs))) n
This probably doesn't deserve to be in an answer of his own, but I can't comment yet. Anyway, here is how I would have written this:
import Data.List import Data.Ord maxIndex :: Ord a => [a] -> Int maxIndex = fst . maximumBy (comparing snd) . zip [0..]