Navigation
index
next
|
previous
|
YSC1212 2019
»
YSC1212 Lecture Notes, Week 05
¶
Strings
Resources
Strings, revisited
Exercise 0
Mini-interlude about Exercise 0.1
Mini-interlude about Exercise 0.2
Mapping a character-to-character function pointwise over a string
Random interlude
Exercise 1
Microscopic (but helpful) interlude about Exercise 1
Exercise 2
General interlude
Exercise 3
General interlude (continued)
Food for thought
General interlude (ended)
Conversion between integers and strings
Formatting strings
Formatted output
Resources
Version
Unparsing values and formatting strings
Resources
Unparsing values
Unparsing Booleans
Interlude about Booleans
Unparsing characters
Interlude about characters
Unparsing strings, or from the frying pan into the fire
Interlude about strings
Unparsing integers
Interlude about integers
Unparsing pairs of Booleans and strings
Exercise 4
Unparsing polymorphic pairs
Unparsing polymorphic triples
Interlude
Exercise 5
The end game: printing unparsed values
Resources
Version
Tracing function calls and returns
Resources
The point
Versions where the calls are traced
Versions where the calls and the returns are traced
Traced versions with an indentation that reflects the nesting of the calls
Resources
Version
The factorial function
Resources
The mandatory unit-test function
Mathematical specification of factorial numbers
How to compute a factorial number, with a little help from our friends
La même chose, with a little help from OCaml
Resources
Version
Induction and recursion over natural numbers
Resources
From inductive data to structurally recursive functions
A first example: doubling up a natural number
Food for thought
Simplifying the definition of the doubling function
Exercise 6
Solution for Exercise 6
Interlude
Exercise 7
Solution for Exercise 7
Aftermath
Exercise 8
The even predicate
The odd predicate
Exercise 9
Declaring a global recursive function
After hours
Vigfus’s dream
Resources
Version
Exercises
Mandatory exercises
Exercise 10
Version
Previous topic
Exercises
Next topic
Strings
Quick search
Enter search terms or a module, class or function name.
Navigation
index
next
|
previous
|
YSC1212 2019
»