Search results

singleton :: forall a. a -> Array a

Create an array of one element

P purescript-arrays M Data.Array
singleton :: Octet -> ByteString

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

P purescript-bytestrings M Data.ByteString
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 s a. Monad f => a -> MealyT f s a
P purescript-machines M Data.Machine.Mealy
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 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 p a. p -> a -> PQueue p a

Create a queue with a single element.

P purescript-pqueue M Data.PQueue
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 a. a -> Set a

Create a set with one element

P purescript-sets M Data.Set
singleton :: forall a. a -> Vec D1 a

Construct a vector containing only a single element.

P purescript-sized-vectors M Data.Vec
singleton :: Char -> String

Returns a string of length 1 containing the given character.

P purescript-strings M Data.String
singleton :: CodePoint -> String

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

P purescript-strings M Data.String.CodePoints
singleton :: forall a. a -* (UniqueArray a)

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

P purescript-substructural M Data.Array.Unique
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 f a. Unfoldable f => a -> f a

Contain a single value. For example:

singleton "foo" == ["foo"] :: Array String
P purescript-unfoldable M Data.Unfoldable

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