I\'m having trouble with currying a function to remove three arguments in Haskell.
Disclaimer: Not Coursework, I was asked this question by someone struggling with
funcB = ((!!) .) . iterate . funcA
I think you did all the hard work, and there was just one tiny step left.
You can indeed do this automatically with pointfree. See the HaskellWiki page
As it says in the github readme, once you've installed it, you can edit your ghci.conf
or .ghci
file with the line
:def pf \str -> return $ ":! pointfree \"" ++ str ++ "\""
and then in ghci when you type
:pf funcB as = (!!) . (iterate . funcA) as
or even
:pf funcB as str n = iterate (funcA as) str !! n
you get
funcB = ((!!) .) . iterate . funcA