summaryrefslogtreecommitdiffhomepage
path: root/purescript.html.markdown
diff options
context:
space:
mode:
authorAdam Bard <github@adambard.com>2015-10-08 11:24:31 +0800
committerAdam Bard <github@adambard.com>2015-10-08 11:24:31 +0800
commitabd7444f9e5343f597b561a69297122142881fc8 (patch)
tree1afa96957269a218ef2a84d9c9a2d4ab462e8fef /purescript.html.markdown
parent5c677e8071291520297ef3d5d8374c6d11285744 (diff)
parent960ee4a1856db8eadb96277bb2422edfa8f2a81c (diff)
Merge pull request #1395 from ghalley/spaces
[en] Remove unnecessary whitespace throughout the english files
Diffstat (limited to 'purescript.html.markdown')
-rw-r--r--purescript.html.markdown12
1 files changed, 6 insertions, 6 deletions
diff --git a/purescript.html.markdown b/purescript.html.markdown
index 6bff7545..a006cdff 100644
--- a/purescript.html.markdown
+++ b/purescript.html.markdown
@@ -70,12 +70,12 @@ true && (9 >= 19 || 1 < 2) -- true
-- Safe access return Maybe a
head [1,2,3] -- Just (1)
-tail [3,2,1] -- Just ([2,1])
+tail [3,2,1] -- Just ([2,1])
init [1,2,3] -- Just ([1,2])
last [3,2,1] -- Just (1)
-- Random access - indexing
[3,4,5,6,7] !! 2 -- Just (5)
--- Range
+-- Range
1..5 -- [1,2,3,4,5]
length [2,2,2] -- 3
drop 3 [5,4,3,2,1] -- [2,1]
@@ -129,10 +129,10 @@ first :: [Number] -> Number
first (x:_) = x
first [3,4,5] -- 3
second :: [Number] -> Number
-second (_:y:_) = y
+second (_:y:_) = y
second [3,4,5] -- 4
sumTwo :: [Number] -> [Number]
-sumTwo (x:y:rest) = (x+y) : rest
+sumTwo (x:y:rest) = (x+y) : rest
sumTwo [2,3,4,5,6] -- [5,4,5,6]
-- sumTwo doesn't handle when the array is empty or just have one
@@ -161,7 +161,7 @@ ecoTitle {title: "The Quantum Thief"} -- Object does not have property author
-- Lambda expressions
(\x -> x*x) 3 -- 9
-(\x y -> x*x + y*y) 4 5 -- 41
+(\x y -> x*x + y*y) 4 5 -- 41
sqr = \x -> x*x
-- Currying
@@ -187,7 +187,7 @@ foldr (+) 0 (1..10) -- 55
sum (1..10) -- 55
product (1..10) -- 3628800
--- Testing with predicate
+-- Testing with predicate
any even [1,2,3] -- true
all even [1,2,3] -- false