query
On this page

take

lib.take

Docs pulled from | This Revision | about 12 hours ago


Return the first (at most) N elements of a list.

Inputs

count

Number of elements to take

list

Input list

Type

take :: int -> [a] -> [a]

Examples

lib.lists.take usage example

take 2 [ "a" "b" "c" "d" ]
=> [ "a" "b" ]
take 2 [ ]
=> [ ]
(lib.lists.take)

Noogle also knows

Aliases