This one of these tricks that when you're unfamiliar with a language is more difficult to find but everybody else knows about and use it.
In my case I wonder what does it mean when you have the name of a variable, say ts
, and you put the symbol \
before it:
newtype Parser a = Parser (String -> [(String, a)])
produce :: a -> Parser a
produce x = Parser (\ts -> [(ts, x)])
My guess is this is abstracting the variable? If so what would be its translation to other languages like Scala?