-
43
pages
-
English
-
Documents
Description
CDuce Programming
Language
Tutorial
Language Version 0.3.2+3
1Table of Contents :
1 Getting started 4
1.1 Key concepts 4
1.2 XML documents 6
1.3 Loading XML files 7
1.4 Type declarations 8
2 First functions 10
2.1 First 10
2.2 Regular Expressions 12
3 Overloading 14
3.1 Overloaded functions 14
4 Patterns 17
4.1 Key concepts 17
4.2 Pair and Record Patterns 17
4.3 Sequence patterns 17
4.4 XML elements and attributes 17
4.5 Handling optional attributes 19
4.6 Recursive patterns 21
4.7 Compiling regular expression patterns 21
5 Error messages and Warnings 23
25.1 Key concepts 23
5.2 Empty types 24
5.3 Unused branches 25
6 References 27
6.1 Introduction 27
6.2 Advanced programming 27
6.3 'ref Empty' is not Empty?! 27
7 Queries 29
7.1 Select from where 29
7.2 XPath-like expressions 29
7.3 Examples 30
8 Higher-order functions 40
8.1 Introduction 40
8.2 A complex example 40
9 Exercises 41
9.1 Tree navigation 41
9.2 Patterns 41
9.3 Solutions 42
10 Tutorial Index 42
31 Getting started
1.1 Key concepts
CDuce is a strongly-typed functional programming language adapted to the
manipulation of XML documents. Its syntax is reminiscent of the ML family, but
CDuce has a completely different type system.
Let us introduce directly some key concepts:
Values are the objects manipulated by CDuce programs; we can distinguish•
several kind of values:
Basic values: integers, characters.•
XML documents and fragments: elements, tag names, strings.•
Constructed values: pairs, records, sequences ...
Language
Tutorial
Language Version 0.3.2+3
1Table of Contents :
1 Getting started 4
1.1 Key concepts 4
1.2 XML documents 6
1.3 Loading XML files 7
1.4 Type declarations 8
2 First functions 10
2.1 First 10
2.2 Regular Expressions 12
3 Overloading 14
3.1 Overloaded functions 14
4 Patterns 17
4.1 Key concepts 17
4.2 Pair and Record Patterns 17
4.3 Sequence patterns 17
4.4 XML elements and attributes 17
4.5 Handling optional attributes 19
4.6 Recursive patterns 21
4.7 Compiling regular expression patterns 21
5 Error messages and Warnings 23
25.1 Key concepts 23
5.2 Empty types 24
5.3 Unused branches 25
6 References 27
6.1 Introduction 27
6.2 Advanced programming 27
6.3 'ref Empty' is not Empty?! 27
7 Queries 29
7.1 Select from where 29
7.2 XPath-like expressions 29
7.3 Examples 30
8 Higher-order functions 40
8.1 Introduction 40
8.2 A complex example 40
9 Exercises 41
9.1 Tree navigation 41
9.2 Patterns 41
9.3 Solutions 42
10 Tutorial Index 42
31 Getting started
1.1 Key concepts
CDuce is a strongly-typed functional programming language adapted to the
manipulation of XML documents. Its syntax is reminiscent of the ML family, but
CDuce has a completely different type system.
Let us introduce directly some key concepts:
Values are the objects manipulated by CDuce programs; we can distinguish•
several kind of values:
Basic values: integers, characters.•
XML documents and fragments: elements, tag names, strings.•
Constructed values: pairs, records, sequences ...
-
Publié par
-
Langue
English