>>> 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
>>> runConduit $ yieldMany [1..5] .| drop 2 .| sinkList [] >>> runConduit $ yieldMany [1..5] .| (drop 2 >> sinkList) [3,4,5]
drop i = take i >> return ()However, drop is more efficient as it does not need to hold values in memory. Subject to fusion Since 0.3.0
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
>>> 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] :> ()