query
On this page

take

lib.lists.take

Docs pulled from | This Revision | 35 minutes 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 [ ]
=> [ ]

Noogle also knows

Aliases