Take the 2-minute tour ×

Anyone knows a book or a web-site that would feature a simple set of railroad diagrams for Haskell grammar?

Something like this but in English:


"Simple" is the key word here. Formal BNFs are too cryptic to be used as a cheat sheet.

share|improve this question
The Haskell report contains a highly detailed and compact representation of Haskell's syntax, albeit in BNF: haskell.org/onlinereport/syntax-iso.html –  IfLoop Nov 21 '12 at 2:29
There are several tools for converting BNF specifications of grammars to syntax (railroad) diagrams. If you can't find the diagrams you're looking for, I would suggest writing or using a pre-written conversion algorithm to generate the diagram form the Haskell BNF specification. –  danportin Nov 21 '12 at 3:16

1 Answer 1

There is some BNF in the Haskell 2010 report (especially in the "Syntax" chapter):


Note that most programs use language extensions which add syntax to the base Haskell language - e.g. the FunctionalDependencies extension. Also, GHC has added new syntax (most recently lambda-case / lambda-if). A list of syntactic extensions supported by GHC 7.6 (currently the latest) is available at:


share|improve this answer

Your Answer


