I just started learning haskell, can someone explain what:
(\a0 -> (collatzLen a0, a0))
is doing?
Maximum finds the largest component of a list and compares on the first element of a pair first, so the pair with the longest sequence length as its first element and the starting value that produced that sequence length as it's second element will be returned by `maximum $ map (\a0 -> (collatzLen a0, a0)) [1..max_a0]`.
This function could also be expressed as `collatzLen >>= (,)`, if you were into that sort of thing.
I think the last bit of the line is:
for a0 in range(1,max_a0):
collatzLen(a0,a0)
a0 is basically the loop variable.