[Haskell-beginners] Where is the accumulator in the expression foldr (<=<) return (replicate x oveKnight)? -- from LYAH example

Olumide 50295 at web.de
Thu Jul 26 01:44:55 UTC 2018


Dear List,

Chapter 13 of LYAH 
(http://learnyouahaskell.com/for-a-few-monads-more#useful-monadic-functions) 
has the following code block

import Data.List

inMany :: Int -> KnightPos -> [KnightPos]
inMany x start = return start >>= foldr (<=<) return (replicate x oveKnight)

What I'd like to know is where the accumulator of foldr is in this example.

Regards,

- Olumide






More information about the Beginners mailing list