1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-09-25 13:58:59 +02:00

Merge pull request #3030 from andys8/elm-tuple-access

[elm] Update code to access tuples
This commit is contained in:
Pratik Karki
2018-01-17 22:16:04 +05:45
committed by GitHub
3 changed files with 6 additions and 6 deletions

View File

@@ -75,8 +75,8 @@ List.head [] -- Nothing
-- K získání hodnot z dvojice použijte funkce first a second.
-- (Toto je pouze zkratka. Brzy si ukážeme, jak na to "správně".)
fst ("elm", 42) -- "elm"
snd ("elm", 42) -- 42
Tuple.first ("elm", 42) -- "elm"
Tuple.second ("elm", 42) -- 42
-- Prázná n-tice, neboli "unit", se občas používá jako zástupný symbol.
-- Je to jediná hodnota svého typu, který se také nazývá "Unit".

View File

@@ -72,8 +72,8 @@ List.head [] -- Nothing
-- Access the elements of a pair with the first and second functions.
-- (This is a shortcut; we'll come to the "real way" in a bit.)
fst ("elm", 42) -- "elm"
snd ("elm", 42) -- 42
Tuple.first ("elm", 42) -- "elm"
Tuple.second ("elm", 42) -- 42
-- The empty tuple, or "unit", is sometimes used as a placeholder.
-- It is the only value of its type, also called "Unit".

View File

@@ -76,8 +76,8 @@ List.head [] -- Nothing
-- Acesse os elementos de um par com as funções first e second.
-- (Este é um atalho; nós iremos para o "caminho real" em breve.)
fst ("elm", 42) -- "elm"
snd ("elm", 42) -- 42
Tuple.first ("elm", 42) -- "elm"
Tuple.second ("elm", 42) -- 42
-- Uma tupla vazia ou "unidade" às vezes é utilizada como um placeholder.
-- É o único valor de seu tipo, também chamado de "Unit".