git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Update README.md
ea83764Phil Freeman
README.md+3−3
@@ -62,18 +62,18 @@ data Person = Person
62 ; age :: Number
62 ; age :: Number
63 }
63 }
64
64
65−extern itoa :: Number -> String
65+extern numberToString :: Number -> String
66
66
67showPerson :: Person -> String
67showPerson :: Person -> String
68showPerson = \p -> case p of
68showPerson = \p -> case p of
69− Person o -> o.name ++ ", aged " ++ itoa(o.age)
69+ Person o -> o.name ++ ", aged " ++ numberToString(o.age)
70```
70```
71
71
72Line by line, this reads as follows:
72Line by line, this reads as follows:
73
73
74- `Person` is a data type with one constructor, also called `Person`
74- `Person` is a data type with one constructor, also called `Person`
75 - The `Person` constructor takes an object with two properties, `name` which is a `String`, and `age` which is a `Number`
75 - 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
77- The `showPerson` function takes a `Person` and returns a `String`
77- The `showPerson` function takes a `Person` and returns a `String`
78- `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.
78- `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.
79
79