“Ugh,” you might think… “Another syntax question, here let me google that for you noob.” But alas! I have googled it, and I am still stumped!
Found in this code from the yesod blog
import System.IO
import Data.Enumerator
import Data.Enumerator.Binary
main =
withFile "output.txt" WriteMode $ \output ->
run_ $ enumFile "input.txt" $$ iterHandle output
However the “$$” operator is new to me. The Haskell 2010 report only mentions it once as an operator symbol. What does it do?
In Haskell, operators like
$$are not part of the syntax, they are user-definable functions. Hence, you need to look up the API documenation for Yesod to see what$$is. In particular, the function$$from your example is documented here.