1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 06:11:49 +03:00

Haddock-friendly docs for Syntax.

This commit is contained in:
Rob Rix 2016-08-04 12:26:07 -04:00
parent 7378668b2c
commit af34a7bf1c

View File

@ -8,9 +8,10 @@ import Test.QuickCheck hiding (Fixed)
import SourceSpan
-- | A node in an abstract syntax tree.
data Syntax
a -- ^ The type of leaves in the syntax tree, typically String, but possibly some datatype representing different leaves more precisely.
f -- ^ The type representing another level of the tree, e.g. the children of branches. Often Cofree or Fix or similar.
--
-- 'a' is the type of leaves in the syntax tree, typically 'Text', but possibly some datatype representing different leaves more precisely.
-- 'f' is the type representing another level of the tree, e.g. the children of branches. Often 'Cofree', 'Free' or similar.
data Syntax a f
-- | A terminal syntax node, e.g. an identifier, or atomic literal.
= Leaf a
-- | An ordered branch of child nodes, expected to be variadic in the grammar, e.g. a list of statements or uncurried function parameters.