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)
P purescript-unfoldable M Data.Unfoldable1
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
P purescript-nonempty M Data.NonEmpty
singleton :: forall a. a -> Array a

Create an array of one element

singleton 2 = [2]
P purescript-arrays M Data.Array
singleton :: forall a. a -> NonEmptyArray a
P purescript-arrays M Data.Array.NonEmpty
singleton :: forall a. a -> List a

Create a list with a single element.

Running time: O(1)

P purescript-lists M Data.List
singleton :: forall a. a -> List a

Create a list with a single element.

Running time: O(1)

P purescript-lists M Data.List.Lazy
singleton :: forall a. a -> NonEmptyList a
P purescript-lists M Data.List.Lazy.NonEmpty
singleton :: forall a. a -> NonEmptyList a
P purescript-lists M Data.List.NonEmpty
singleton :: forall f a. Applicative f => a -> ListT f a

Create a list with one element.

P purescript-transformers M Control.Monad.List.Trans
singleton :: CodePoint -> String

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

>>> map singleton (toEnum 0x1D400)
Just "𝐀"
P purescript-strings M Data.String.CodePoints
singleton :: Char -> String

Returns a string of length 1 containing the given character.

singleton 'l' == "l"
P purescript-strings M Data.String.CodeUnits
singleton :: CodePoint -> NonEmptyString
P purescript-strings M Data.String.NonEmpty.CodePoints
singleton :: Char -> NonEmptyString

Creates a NonEmptyString from a character.

P purescript-strings M Data.String.NonEmpty.CodeUnits
singleton :: forall k v. k -> v -> Map k v

Create a map with one key/value pair

P purescript-ordered-collections M Data.Map.Internal
singleton :: forall a. a -> Set a

Create a set with one element

P purescript-ordered-collections M Data.Set
singleton :: forall a. a -> NonEmptySet a

Create a set with one element.

P purescript-ordered-collections M Data.Set.NonEmpty
singleton :: forall a. String -> a -> Object a

Create an Object a with one key/value pair

P purescript-foreign-object M Foreign.Object
singleton :: forall a. a -> CatList a

Create a catenable list with a single item.

Running time: O(1)

P purescript-catenable-lists M Data.CatList
singleton :: forall a. a -> CatQueue a

Create a queue containing a single element.

Running time: O(1)

P purescript-catenable-lists M Data.CatQueue
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

P purescript-unordered-collections M Data.HashMap
singleton :: forall a. Hashable a => a -> HashSet a

The singleton set.

P purescript-unordered-collections M Data.HashSet
singleton :: forall a. a -> Vec D1 a

Construct a vector containing only a single element.

P purescript-sized-vectors M Data.Vec
singleton :: forall f i o. Applicative f => o -> MealyT f i o

Creates a machine which emits a single value before halting.

P purescript-machines M Data.Machine.Mealy
singleton :: Octet -> ByteString

O(1) A byte string with a single byte.

P purescript-bytestrings M Data.ByteString

Create a Vect of one element.

vect :: Vect 1 String
vect = singleton "a"
P purescript-fast-vect M Data.FastVect.Common
singleton :: forall elem. Singleton Vect elem

Create a Vect of one element.

vect :: Vect 1 String
vect = singleton "a"
P purescript-fast-vect M Data.FastVect.FastVect
singleton :: forall elem. elem -> Matrix 1 1 elem

Create Matrix of one element.

P purescript-fast-vect M Data.FastVect.FastVect.Matrix
singleton :: forall elem. Singleton MinLenVect elem

Create a MinLenVect of one element.

minLenVect :: MinLenVect 1 String
minLenVect = singleton "a"
P purescript-fast-vect M Data.FastVect.MinLenVect
singleton :: forall elem. Singleton Vect elem

Create a Vect of one element.

vect :: Vect 1 String
vect = singleton "a"
P purescript-fast-vect M Data.FastVect.Sparse.Read
singleton :: forall elem. Singleton Vect elem

Create a Vect of one element.

vect :: Vect 1 String
vect = singleton "a"
P purescript-fast-vect M Data.FastVect.Sparse.Write
singleton :: forall a. a -> OSet a
P purescript-ordered-set M Data.Set.Ordered
singleton :: forall a. a -> Seq a

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

P purescript-sequences M Data.Sequence
singleton :: forall a. a -> Seq a

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

P purescript-sequences M Data.Sequence.NonEmpty
singleton :: DataBuff -> Builder

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

P purescript-arraybuffer-builder M Data.ArrayBuffer.Builder.Internal
singleton :: forall da a. Patch a da => Jet a -> Jet (IArray a)

Construct an array from a single element.

P purescript-incremental-functions M Data.Incremental.Array
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.

P purescript-incremental-functions M Data.Incremental.Map
singleton :: forall n. n -> NonEmpty n
P purescript-intervals M Math.Interval
singleton :: forall k v. EncodeKey k => k -> v -> Map k v
P purescript-js-maps M JS.Map.Internal
singleton :: forall k v. Key k => k -> v -> Map k v

Create an Map a with one key/value pair

P purescript-js-maps M JS.Map.Primitive.Internal
singleton :: JSON -> JArray

Creates a JArray with a single entry.

P purescript-json M JSON.Array
singleton :: String -> JSON -> JObject

Creates an JObject with a single entry.

P purescript-json M JSON.Object
singleton :: forall a. Hashable a => a -> MultiSet a
P purescript-multiset-hashed M Data.HashSet.Multi
singleton :: forall a p. p -> a -> PQueue p a

Create a queue with a single element.

P purescript-pqueue M Data.PQueue
singleton :: forall v s r g f. Cons s v () r => Lacks s () => RSingleton f g s => g s -> v -> f r
P purescript-struct M Data.Struct.Singleton
singleton :: forall a l g r. IsSymbol l => Cons l a () r => Lacks l () => SProxying g l => g l -> a -> Record r
P purescript-struct M Data.Struct.Utils.Record
singleton :: forall a. a -> ArrayView a
P purescript-array-views M Data.ArrayView.Internal
singleton :: forall a. a -> NonEmptyArrayView a
P purescript-array-views M Data.ArrayView.NonEmpty
singleton :: forall a cnt. Diff cnt => a -> Difference cnt a
P purescript-difference-containers M Containers.Difference
singleton :: String -> Alias

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

P purescript-env-names M Data.String.Env
singleton :: forall a t. Ord a => a -> Heap t a
P purescript-heap M Data.Heap