“Daftar Haskell” Kode Jawaban

Dapatkan Ekor Daftar Haskell

list = [1, 2, 3, 4]

tail :: [a] -> [a]
tail [] = []
tail (_:xs) = xs
Perfect Peafowl

Daftar 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

Jawaban yang mirip dengan “Daftar Haskell”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya