git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Update README.md
commitea837647c9efcc0577ee52abca70903c90936732 authorPhil Freeman <paf31@cantab.net> dateFri 1 Nov 2013, 11:21 (13 years ago) parent1b77d7e
1 file changed+3−3
README.md+3−3
README.md+3−3
@@ -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