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

14 lines
348 B
Haskell

module PreduleModule1 where
take n _ | n <= 0 = []
take _ [] = []
take n x:xs = x:take ((n-1) xs)
drop n xs | n <= 0 = xs
drop _ [] = []
drop n x:xs = drop((n-1) xs)
splitAt n xs = (take(n xs), drop(n xs))
[] `plusplus` ys = ys
x:xs `plusplus` ys = x:(xs `plusplus` ys)