query
On this page

singleton

lib.singleton

Docs pulled from | This Revision | 39 minutes ago


Create a list consisting of a single element. singleton x is sometimes more convenient with respect to indentation than [x] when x spans multiple lines.

Inputs

x

1. Function argument

Type

singleton :: a -> [a]

Examples

lib.lists.singleton usage example

singleton "foo"
=> [ "foo" ]
(lib.lists.singleton)

Noogle also knows

Aliases