summaryrefslogtreecommitdiffhomepage
path: root/purescript.html.markdown
diff options
context:
space:
mode:
authorDmitrii Kuznetsov <torgeek@gmail.com>2021-02-22 18:42:33 +0300
committerDmitrii Kuznetsov <torgeek@gmail.com>2021-02-22 18:42:33 +0300
commite09fefaa3e78c645c720c86391e3f96d257be8a9 (patch)
tree0ff8b235e3e707125e2b11d5268ad085832355cb /purescript.html.markdown
parentf4c740839d78f797e9cbcfa1eb0483ac0ea45501 (diff)
parentbc8bd2646f068cfb402850f7c0f9b1dbfe81e5a0 (diff)
Merge branch 'master' of https://github.com/torgeek/learnxinyminutes-docs
Diffstat (limited to 'purescript.html.markdown')
-rw-r--r--purescript.html.markdown8
1 files changed, 5 insertions, 3 deletions
diff --git a/purescript.html.markdown b/purescript.html.markdown
index b413a9e3..6b74ac64 100644
--- a/purescript.html.markdown
+++ b/purescript.html.markdown
@@ -1,5 +1,6 @@
---
language: purescript
+filename: purescript.purs
contributors:
- ["Fredrik Dyrkell", "http://www.lexicallyscoped.com"]
- ["Thimoteus", "https://github.com/Thimoteus"]
@@ -65,12 +66,13 @@ true && (9 >= 19 || 1 < 2) -- true
"""Hello
world""" -- "Hello\nworld"
-- Concatenate
-"such " ++ "amaze" -- "such amaze"
+"such " <> "amaze" -- "such amaze"
--
-- 2. Arrays are Javascript arrays, but must be homogeneous
-[1,1,2,3,5,8] :: Array Number -- [1,1,2,3,5,8]
+[1,1,2,3,5,8] :: Array Int -- [1,1,2,3,5,8]
+[1.2,2.0,3.14] :: Array Number -- [1.2,2.0,3.14]
[true, true, false] :: Array Boolean -- [true,true,false]
-- [1,2, true, "false"] won't work
-- `Cannot unify Prim.Int with Prim.Boolean`
@@ -85,7 +87,7 @@ head [1,2,3] -- Just (1)
tail [3,2,1] -- Just ([2,1])
init [1,2,3] -- Just ([1,2])
last [3,2,1] -- Just (1)
--- Random access - indexing
+-- Array access - indexing
[3,4,5,6,7] !! 2 -- Just (5)
-- Range
1..5 -- [1,2,3,4,5]