pascalabcnet/TestSamples/Haskell_Samples/Corteg2.hs
Бондарев Иван e6e67c193c initial commit
2015-05-14 21:35:07 +02:00

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]]);
}