A more-notation can go with quotations in both ways, and with splices in both ways. For example, you can have <tt>$(doThis 0 [more MoreDoThis])</tt> with declarations having to do with <tt>MoreDoThis</tt> outside of the splice.

===Manipulation in splices===

===Manipulation in splices===

Line 210:

Line 211:

===Literate programming===

===Literate programming===

+

You might want a datatype or something else representing features of the program, and you might want to organize them into chapters. Therefore, you can define things in the chapter they belong.

numeric_literal: It should be a natural number. Omitted is the same as zero. This number is called the "order" of the declaration.

enumeration_constructor: A constructor of the enumeration that was specified in the more-notation. If an enumeration is specified, the enumeration constructor is required here. This number is called the "order" of the declaration.

parameters: Lowercased names which will be scoped locally to this declaration. The number of parameters must match the number of parameters specified in the more-notation. An unused parameter can be replaced by an underscore.

A field in either a data type declaration or in a value construction or update syntax can be replaced by more-notation. Semantics of more-declarations becomes as follows:

Duplicate fields are removed.

Duplicate fields that do not match are errors.

A more-declaration can specify both the type and the value. Types are only used in data type declarations and values only in the other places.

In addition, parameters of a more-notation used in a field more-notation of a datatype declaration can be named _ in which case that parameter can only be used to compute the value of the field, not the type of the field. It is also permitted in a field more-notation of a value construction or update syntax, which case that parameter is not used for value construction and can only be used to compute the type. If there is a parameter that is named _ neither in the value or datatype declaration, then it has to be a type but you can use that type both in the type of the field and in types used for computing values of that field.

A more-notation can go with quotations in both ways, and with splices in both ways. For example, you can have $(doThis 0 [more MoreDoThis]) with declarations having to do with MoreDoThis outside of the splice.

In the ParseSyntax.hs file, everything has to be defined multiple times in different places, and in a common way. Using more-notation with Template Haskell could fix that. You could even put different extensions in different files and then combine them into one file.

In MSE, there are game templates, style templates, and export templates. Let's say you could somehow write them as a value in Haskell (MSE has some impure functions, but it is possible to make pure versions of those functions).

You could have a card datatype like this (if the cardStyle is Nothing then it uses the default style for the set):