Section 10


We will do the 8-Quene problem today.

Some syntax sugar first.

The followings are equivalent:

putStrLn (show (1 + 1))
putStrLn $ show $ 1 + 1
putStrLn . show $ 1 + 1

The $ sign is used to avoid parenthesis. Whatever on the right of it takes precedence. . sign is used to chain functions. The output of RHS will be the input of LHS.

And here is a very good place to lookup useful functions in the Prelude module of Haskell.