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.

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 :: CodePoint -> String

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

>>> map singleton (codePointFromInt 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 f a. Applicative f => a -> ListT f a

Create a list with one element.

P purescript-transformers M Control.Monad.List.Trans
singleton :: forall k v. k -> v -> Map k v

Create a map with one key/value pair

P purescript-maps M Data.Map
singleton :: forall a. String -> a -> StrMap a

Create a map with one key/value pair

P purescript-maps M Data.StrMap
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. 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 -> Set a

Create a set with one element

P purescript-sets M Data.Set
singleton :: forall a. String -> a -> Object a

Create a map with one key/value pair

P purescript-foreign-object M Foreign.Object
singleton :: forall f s a. Monad f => a -> MealyT f s a
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
singleton :: forall a. a -> Vec D1 a

Construct a vector containing only a single element.

P purescript-sized-vectors M Data.Vec
singleton :: forall a da. 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 k v dv. 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 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 :: forall t a. Ord a => a -> Heap t a
P purescript-heap M Data.Heap
singleton :: forall p a. p -> a -> PQueue p a

Create a queue with a single element.

P purescript-pqueue M Data.PQueue
singleton :: forall a. a -> Matrix D1 D1 a
P purescript-sized-matrices M Data.Matrix.Reps
singleton :: forall l r f a. IsSymbol l => Cons l (Proxy2 f) () r => SProxy l -> f a -> Smash r a

Construct a value of type Smash (l :: Proxy2 f) by lifting a value of type f a.

P purescript-smash M Data.Smash
singleton :: forall a. a -> SortedArray a

Creates a singleton array which is by definition sorted.

P purescript-sorted-arrays M Data.SortedArray
singleton :: forall a. a -* (UniqueArray a)

O(1) memory, O(1) time. A singleton array.

P purescript-substructural M Data.Array.Unique
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 k v. Hashable k => k -> v -> HashMap k v
P purescript-unordered-containers M Data.HashMap

Instances must follow these laws:

inverse :: forall f a. Applicative f => Prop
inverse =
     (getSingleton :: f a -> a) <<< (pure :: a -> f a)
  == (id :: a -> a)

viaconst :: forall f a b. Functor f => Prop
viaconst = forall (x :: b). forall (xs :: f a).
     (getSingleton :: f b -> b) <<< (map (const x) :: f a -> f b)
  == (const x :: f a -> b)
P purescript-monad-control M Data.Functor.Singleton
P purescript-monad-control M Data.Functor.Singleton
P purescript-monad-control M Data.Functor.Singleton
P purescript-monad-control M Data.Functor.Singleton
P purescript-monad-control M Data.Functor.Singleton
P purescript-monad-control M Data.Functor.Singleton
P purescript-monad-control M Data.Functor.Singleton

No further results.