>>> drop 6 "Hello World!" "World!" >>> drop 3 [1,2,3,4,5] [4,5] >>> drop 3 [1,2] [] >>> drop 3 [] [] >>> drop (-1) [1,2] [1,2] >>> drop 0 [1,2] [1,2]It is an instance of the more general genericDrop, in which n may be of any integral type.
drop n = fromDistinctAscList . drop n . toAscList
drop n = fromDistinctAscList . drop n . toAscList
drop 0 = cat drop (m + n) = drop m >-> drop n
\(Shape xs) (List ys) -> Match.drop xs ys == List.drop (length xs) ys
\(Shape xs) (List ys) -> Match.take xs ys ++ Match.drop xs ys == ys
fold (drop n folder) list = fold folder (Data.List.genericDrop n list)
>>> Foldl.fold (Foldl.drop 3 Foldl.sum) [10, 20, 30, 1, 2, 3] 6
>>> Foldl.fold (Foldl.drop 10 Foldl.sum) [10, 20, 30, 1, 2, 3] 0
>>> S.toList $ S.drop 2 $ S.replicateM 5 getLine a<Enter> b<Enter> c<Enter> d<Enter> e<Enter> ["c","d","e"] :> ()Because it retains the final return value, drop n is a suitable argument for maps:
>>> S.toList $ concats $ maps (S.drop 4) $ chunksOf 5 $ each [1..20] [5,10,15,20] :> ()