singleton
lib.singleton
Docs pulled from | This Revision | about 9 hours 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" ]