0

I am reading through this blog post about writing an API in Haskell with Scotty, and I came across the section on monad transformers. I understand the concept of monad transformers, but I cannot wrap my head around what's going on here:

let r m = runReaderT (runConfigM m) c

How can the expression reference m when m is declared in the same let expression that uses it? What is going on here? What is m?

Cactus
  • 27,075
  • 9
  • 69
  • 149
npj
  • 108
  • 6

1 Answers1

6

That's a (local) function declaration with the name r. m is the function's parameter. It's equivalent to:

let r = \m -> runReaderT (runConfigM m) c
Benjamin Hodgson
  • 42,952
  • 15
  • 108
  • 157