Search results

singleton :: forall f a. Unfoldable1 f => a -> f a

Contain a single value. For example:

singleton "foo" == (NEL.singleton "foo" :: NEL.NonEmptyList String)
singleton :: forall f a. Plus f => a -> NonEmpty f a

Create a non-empty structure with a single value.

import Prelude

singleton 1 == 1 :| []
singleton 1 == 1 :| Nil
singleton :: forall a. a -> Array a

Create an array of one element

singleton 2 = [2]
singleton :: forall a. a -> NonEmptyArray a
singleton :: forall a. a -> List a

Create a list with a single element.

Running time: O(1)

singleton :: forall a. a -> List a

Create a list with a single element.

Running time: O(1)

singleton :: forall a. a -> NonEmptyList a
singleton :: forall a. a -> NonEmptyList a
singleton :: forall f a. Applicative f => a -> ListT f a

Create a list with one element.

singleton :: CodePoint -> String

Creates a string containing just the given code point. Operates in constant space and time.

>>> map singleton (toEnum 0x1D400)
Just "𝐀"
singleton :: Char -> String

Returns a string of length 1 containing the given character.

singleton 'l' == "l"
singleton :: CodePoint -> NonEmptyString
singleton :: Char -> NonEmptyString

Creates a NonEmptyString from a character.

singleton :: forall k v. k -> v -> Map k v

Create a map with one key/value pair

singleton :: forall a. a -> Set a

Create a set with one element

singleton :: forall a. a -> NonEmptySet a

Create a set with one element.

singleton :: forall a. String -> a -> Object a

Create an Object a with one key/value pair

singleton :: forall a. a -> CatList a

Create a catenable list with a single item.

Running time: O(1)

singleton :: forall a. a -> CatQueue a

Create a queue containing a single element.

Running time: O(1)

singleton :: forall k v. Hashable k => k -> v -> HashMap k v

A map of one key and its associated value.

singleton k v == insert k v empty

singleton :: forall a. Hashable a => a -> HashSet a

The singleton set.

singleton :: forall a. a -> Vec D1 a

Construct a vector containing only a single element.

singleton :: forall f i o. Applicative f => o -> MealyT f i o

Creates a machine which emits a single value before halting.

singleton :: SourceToken -> TokenList

Create a Vect of one element.

vect :: Vect 1 String
vect = singleton "a"
singleton :: forall elem. Singleton Vect elem

Create a Vect of one element.

vect :: Vect 1 String
vect = singleton "a"
singleton :: forall elem. elem -> Matrix 1 1 elem

Create Matrix of one element.

singleton :: forall elem. Singleton MinLenVect elem

Create a MinLenVect of one element.

minLenVect :: MinLenVect 1 String
minLenVect = singleton "a"
singleton :: forall elem. Singleton Vect elem

Create a Vect of one element.

vect :: Vect 1 String
vect = singleton "a"
singleton :: forall elem. Singleton Vect elem

Create a Vect of one element.

vect :: Vect 1 String
vect = singleton "a"
singleton :: forall a. a -> OSet a
singleton :: forall a. a -> Seq a

O(1). Create a Seq with one element.

singleton :: forall a. a -> Seq a

O(1). Construct a sequence from a single element.

singleton :: JSON -> JArray

Creates a JArray with a single entry.

singleton :: String -> JSON -> JObject

Creates an JObject with a single entry.

singleton :: DataBuff -> Builder

Construct a Builder with a single DataBuff. O(1)

singleton :: forall da a. Patch a da => Jet a -> Jet (IArray a)

Construct an array from a single element.

singleton :: forall dv v k. Ord k => Patch v dv => k -> Jet v -> Jet (IMap k v)

Construct a map from a key/value pair.

singleton :: forall n. n -> NonEmpty n
singleton :: forall k v. EncodeKey k => k -> v -> Map k v
singleton :: forall k v. Key k => k -> v -> Map k v

Create an Map a with one key/value pair

singleton :: forall a. Hashable a => a -> MultiSet a
singleton :: forall a p. p -> a -> PQueue p a

Create a queue with a single element.

singleton :: forall v s r g f. Cons s v () r => Lacks s () => RSingleton f g s => g s -> v -> f r
singleton :: forall a l g r. IsSymbol l => Cons l a () r => Lacks l () => SProxying g l => g l -> a -> Record r
singleton :: forall a. a -> ArrayView a
singleton :: forall a. a -> NonEmptyArrayView a
singleton :: forall a cnt. Diff cnt => a -> Difference cnt a
singleton :: String -> Alias

Create an Alias who's short and long forms are the same.

singleton :: forall a t. Ord a => a -> Heap t a