Ad
  • Custom User Avatar

    What beautifully obfuscated code! First it bulds up the list in the third element of the triple, going all the way from the very inside of the foldr structure to the very outside. At the outside, the 2nd element gets used as the return value of the top-level function. It gets evaluated with a definition of foldl hidden in the first element of the tuple passed to g on the last line, as well as in the 2nd element returned in the [] case. Still, implements foldl without using foldr - try doing it that way - it's trickier!