git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Hello World sample
commitdfb07d2bd7802d1f1db5e840cae6a0f7ebf9fbcf authorPhil Freeman <paf31@cantab.net> dateSun 10 Nov 2013, 11:47 (13 years ago) parent6a0418f
1 file changed+19−1
README.md+19−1
README.md+19−1
@@ -60,7 +60,25 @@ PureScript is *not* designed to be a general-purpose programming language. The p
6060
6161PureScript can also be seen as a trade-off between a theoretically ideal language and one which generates reasonably high performance code.
6262
63−## First Example
63+## Hello, PureScript!
64+
65+As an introductory example, here is the usual "Hello World" written in PureScript:
66+
67+```haskell
68+foreign import console :: { log :: String -> {} }
69+
70+main = \() -> console.log "Hello, World!"
71+```
72+
73+which compiles to the following Javascript:
74+
75+```javascript
76+function main() {
77+ console.log("Hello, World!");
78+}
79+```
80+
81+## Another Example
6482
6583The following code defines a `Person` data type and a function to generate a string representation for a `Person`:
6684