@@ -62,18 +62,18 @@ data Person = Person
6262 ; age :: Number
6363 }
6464
65−extern itoa :: Number -> String
65+extern numberToString :: Number -> String
6666
6767showPerson :: Person -> String
6868showPerson = \p -> case p of
69− Person o -> o.name ++ ", aged " ++ itoa(o.age)
69+ Person o -> o.name ++ ", aged " ++ numberToString(o.age)
7070```
7171
7272Line by line, this reads as follows:
7373
7474- `Person` is a data type with one constructor, also called `Person`
7575 - The `Person` constructor takes an object with two properties, `name` which is a `String`, and `age` which is a `Number`
76−- The `itoa` function is written in Javascript, and takes a `Number` and returns a `String`
76+- The `numberToString` function is written in Javascript, and converts a `Number` to its `String` representation
7777- The `showPerson` function takes a `Person` and returns a `String`
7878- `showPerson` works by case analysis on its argument `p`, first matching the constructor `Person` and then using string concatenation and object accessors to return its result.
7979
@@ -84,12 +84,12 @@ var Person = function (value) {
8484 return { ctor: 'Person', value: value };
8585};
8686
87−var showPerson = function (p) {
87+function showPerson(p) {
8888 return (function (_0) {
8989 if (_0.ctor === "Person") {
9090 var _1 = _0.value;
9191 var o = _1;
92− return o.name ++ ", aged " ++ itoa(o.age);
92+ return o.name ++ ", aged " ++ numberToString(o.age);
9393 }
9494 throw "Failed pattern match";
9595 })(p);