and , ]
are used to get the abstract syntax tree for the enclosed expression and 'splice' brackets $(
and )
are used to convert from abstract syntax tree into code.
As of GHC-6.10, Template Haskell provides support for user-defined quasi-quoters, which allows users to write parsers which can generate Haskell code from an arbitrary syntax. This syntax is also enforced at compile time. For example, using a custom quasi-quoter for regular expressions
A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" or ...
could look like this:
digitsFollowedByLetters = \d+ \s+ ,
Example
A common idiom is to quasi-quote an expression
Expression may refer to:
Linguistics
* Expression (linguistics), a word, phrase, or sentence
* Fixed expression, a form of words with a specific meaning
* Idiom, a type of fixed expression
* Metaphorical expression, a particular word, phrase, o ...
, perform some transformation on the expression and splice the result back into the program. It could be written as:
result = $( transform
References
{{reflist
External links
Template Haskell Wiki Page
Experimental programming languages
Haskell programming language family
Functional languages
Metaprogramming>
and , /code> are used to get the abstract syntax tree for the enclosed expression and 'splice' brackets $(
and )
are used to convert from abstract syntax tree into code.
As of GHC-6.10, Template Haskell provides support for user-defined quasi-quoters, which allows users to write parsers which can generate Haskell code from an arbitrary syntax. This syntax is also enforced at compile time. For example, using a custom quasi-quoter for regular expressions
A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" or ...
could look like this:
digitsFollowedByLetters = \d+ \s+ ,
Example
A common idiom is to quasi-quote an expression
Expression may refer to:
Linguistics
* Expression (linguistics), a word, phrase, or sentence
* Fixed expression, a form of words with a specific meaning
* Idiom, a type of fixed expression
* Metaphorical expression, a particular word, phrase, o ...
, perform some transformation on the expression and splice the result back into the program. It could be written as:
result = $( transform
References
{{reflist
External links
Template Haskell Wiki Page
Experimental programming languages
Haskell programming language family
Functional languages
Metaprogramming> input , )
References
{{reflist
External links
Template Haskell Wiki Page
Experimental programming languages
Haskell programming language family
Functional languages
Metaprogramming>
and , /code> are used to get the abstract syntax tree for the enclosed expression and 'splice' brackets $(
and )
are used to convert from abstract syntax tree into code.
As of GHC-6.10, Template Haskell provides support for user-defined quasi-quoters, which allows users to write parsers which can generate Haskell code from an arbitrary syntax. This syntax is also enforced at compile time. For example, using a custom quasi-quoter for regular expressions
A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" or ...
could look like this:
digitsFollowedByLetters = \d+ \s+ ,
Example
A common idiom is to quasi-quote an expression
Expression may refer to:
Linguistics
* Expression (linguistics), a word, phrase, or sentence
* Fixed expression, a form of words with a specific meaning
* Idiom, a type of fixed expression
* Metaphorical expression, a particular word, phrase, o ...
, perform some transformation on the expression and splice the result back into the program. It could be written as:
result = $( transform
References
{{reflist
External links
Template Haskell Wiki Page
Experimental programming languages
Haskell programming language family
Functional languages
Metaprogramming>
and , /code> are used to get the abstract syntax tree for the enclosed expression and 'splice' brackets $(
and )
are used to convert from abstract syntax tree into code.
As of GHC-6.10, Template Haskell provides support for user-defined quasi-quoters, which allows users to write parsers which can generate Haskell code from an arbitrary syntax. This syntax is also enforced at compile time. For example, using a custom quasi-quoter for regular expressions
A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" or ...
could look like this:
digitsFollowedByLetters = \d+ \s+ ,
Example
A common idiom is to quasi-quote an expression
Expression may refer to:
Linguistics
* Expression (linguistics), a word, phrase, or sentence
* Fixed expression, a form of words with a specific meaning
* Idiom, a type of fixed expression
* Metaphorical expression, a particular word, phrase, o ...
, perform some transformation on the expression and splice the result back into the program. It could be written as:
result = $( transform input , )
References
{{reflist
External links
Template Haskell Wiki Page
Experimental programming languages
Haskell programming language family
Functional languages
Metaprogramming> input , )
References
{{reflist
External links
Template Haskell Wiki Page
Experimental programming languages
Haskell programming language family
Functional languages
Metaprogramming> input , )
References
{{reflist
External links
Template Haskell Wiki Page
Experimental programming languages
Haskell programming language family
Functional languages
Metaprogramming> input , )
References
{{reflist
External links
Template Haskell Wiki Page
Experimental programming languages
Haskell programming language family
Functional languages
Metaprogramming>
and , /code> are used to get the abstract syntax tree for the enclosed expression and 'splice' brackets $(
and )
are used to convert from abstract syntax tree into code.
As of GHC-6.10, Template Haskell provides support for user-defined quasi-quoters, which allows users to write parsers which can generate Haskell code from an arbitrary syntax. This syntax is also enforced at compile time. For example, using a custom quasi-quoter for regular expressions
A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" or ...
could look like this:
digitsFollowedByLetters = \d+ \s+ ,
Example
A common idiom is to quasi-quote an expression
Expression may refer to:
Linguistics
* Expression (linguistics), a word, phrase, or sentence
* Fixed expression, a form of words with a specific meaning
* Idiom, a type of fixed expression
* Metaphorical expression, a particular word, phrase, o ...
, perform some transformation on the expression and splice the result back into the program. It could be written as:
result = $( transform
References
{{reflist
External links
Template Haskell Wiki Page
Experimental programming languages
Haskell programming language family
Functional languages
Metaprogramming>
and , /code> are used to get the abstract syntax tree for the enclosed expression and 'splice' brackets $(
and )
are used to convert from abstract syntax tree into code.
As of GHC-6.10, Template Haskell provides support for user-defined quasi-quoters, which allows users to write parsers which can generate Haskell code from an arbitrary syntax. This syntax is also enforced at compile time. For example, using a custom quasi-quoter for regular expressions
A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" or ...
could look like this:
digitsFollowedByLetters = \d+ \s+ ,
Example
A common idiom is to quasi-quote an expression
Expression may refer to:
Linguistics
* Expression (linguistics), a word, phrase, or sentence
* Fixed expression, a form of words with a specific meaning
* Idiom, a type of fixed expression
* Metaphorical expression, a particular word, phrase, o ...
, perform some transformation on the expression and splice the result back into the program. It could be written as:
result = $( transform
References
{{reflist
External links
Template Haskell Wiki Page
Experimental programming languages
Haskell programming language family
Functional languages
Metaprogramming> input , )
References
{{reflist
External links
Template Haskell Wiki Page
Experimental programming languages
Haskell programming language family
Functional languages
Metaprogramming>
and , /code> are used to get the abstract syntax tree for the enclosed expression and 'splice' brackets $(
and )
are used to convert from abstract syntax tree into code.
As of GHC-6.10, Template Haskell provides support for user-defined quasi-quoters, which allows users to write parsers which can generate Haskell code from an arbitrary syntax. This syntax is also enforced at compile time. For example, using a custom quasi-quoter for regular expressions
A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" or ...
could look like this:
digitsFollowedByLetters = \d+ \s+ ,
Example
A common idiom is to quasi-quote an expression
Expression may refer to:
Linguistics
* Expression (linguistics), a word, phrase, or sentence
* Fixed expression, a form of words with a specific meaning
* Idiom, a type of fixed expression
* Metaphorical expression, a particular word, phrase, o ...
, perform some transformation on the expression and splice the result back into the program. It could be written as:
result = $( transform
References
{{reflist
External links
Template Haskell Wiki Page
Experimental programming languages
Haskell programming language family
Functional languages
Metaprogramming>
and , /code> are used to get the abstract syntax tree for the enclosed expression and 'splice' brackets $(
and )
are used to convert from abstract syntax tree into code.
As of GHC-6.10, Template Haskell provides support for user-defined quasi-quoters, which allows users to write parsers which can generate Haskell code from an arbitrary syntax. This syntax is also enforced at compile time. For example, using a custom quasi-quoter for regular expressions
A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" or ...
could look like this:
digitsFollowedByLetters = \d+ \s+ ,
Example
A common idiom is to quasi-quote an expression
Expression may refer to:
Linguistics
* Expression (linguistics), a word, phrase, or sentence
* Fixed expression, a form of words with a specific meaning
* Idiom, a type of fixed expression
* Metaphorical expression, a particular word, phrase, o ...
, perform some transformation on the expression and splice the result back into the program. It could be written as:
result = $( transform input , )
References
{{reflist
External links
Template Haskell Wiki Page
Experimental programming languages
Haskell programming language family
Functional languages
Metaprogramming> input , )
References
{{reflist
External links
Template Haskell Wiki Page
Experimental programming languages
Haskell programming language family
Functional languages
Metaprogramming> input , )
References
{{reflist
External links
Template Haskell Wiki Page
Experimental programming languages
Haskell programming language family
Functional languages
Metaprogramming> input , )
References
{{reflist
External links
Template Haskell Wiki Page
Experimental programming languages
Haskell programming language family
Functional languages
Metaprogramming