“Elemento da lista de acesso Haskell” Respostas de código

Primeiro elemento na lista Haskell

list = [1, 2, 3]

head :: [a] -> a
head (x:_) = x

head list -- 1
Hippo_error

Haskell Append to List

1 : [2, 3]
--return [1, 2, 3]
yeah tiger

Elemento da lista de acesso Haskell

--Haskell Lists' are 0 based
--Let xs be a list from where we want the n-th element
?> xs !! n

--Example
?> [1, 2, 3] !! 1
?> 2
theRealCb

Respostas semelhantes a “Elemento da lista de acesso Haskell”

Perguntas semelhantes a “Elemento da lista de acesso Haskell”

Procure respostas de código populares por idioma

Procurar outros idiomas de código