24 lines
476 B
Haskell
24 lines
476 B
Haskell
module Main where
|
|
|
|
head [] = "Prelude.head: ïóñòîé ñïèñîê"
|
|
head x:xs = x
|
|
|
|
tail [] = "Prelude.tail: ïóñòîé ñïèñîê"
|
|
tail x:xs = xs
|
|
|
|
length [] = 0
|
|
length h:t = (length t) + 1
|
|
|
|
f = [[1,2],[2],[3]]
|
|
|
|
g = (head [[[1],[2,3]],[2],[3]])
|
|
|
|
h = (tail [[1,2],[2],[3]])
|
|
|
|
main = do {
|
|
(print f);
|
|
(print g);
|
|
(print h);
|
|
(print(length(head [[1,2],[2],[3]])));
|
|
(print [[1],[5],[6]]);
|
|
} |