singleton
lib.lists.singleton
Docs pulled from | This Revision | 17 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" ]