mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-10 00:36:48 +02:00
Cons (:) requires purescript-arrays
This commit is contained in:
@@ -77,12 +77,12 @@ world""" -- "Hello\nworld"
|
|||||||
[true, true, false] :: Array Boolean -- [true,true,false]
|
[true, true, false] :: Array Boolean -- [true,true,false]
|
||||||
-- [1,2, true, "false"] won't work
|
-- [1,2, true, "false"] won't work
|
||||||
-- `Cannot unify Int with Boolean`
|
-- `Cannot unify Int with Boolean`
|
||||||
|
|
||||||
|
-- Requires purescript-arrays (Data.Array)
|
||||||
-- Cons (prepend)
|
-- Cons (prepend)
|
||||||
1 : [2,4,3] -- [1,2,4,3]
|
1 : [2,4,3] -- [1,2,4,3]
|
||||||
|
|
||||||
-- Requires purescript-arrays (Data.Array)
|
|
||||||
-- and purescript-maybe (Data.Maybe)
|
-- and purescript-maybe (Data.Maybe)
|
||||||
|
|
||||||
-- Safe access return Maybe a
|
-- Safe access return Maybe a
|
||||||
head [1,2,3] -- Just (1)
|
head [1,2,3] -- Just (1)
|
||||||
tail [3,2,1] -- Just ([2,1])
|
tail [3,2,1] -- Just ([2,1])
|
||||||
|
Reference in New Issue
Block a user