Hoogle Search
Within LTS Haskell 24.53 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
ghc-internal GHC.Internal.Data.OldList Construct a list from a single element.
Examples
>>> singleton True [True]
>>> singleton [1, 2, 3] [[1,2,3]]
>>> singleton 'c' "c"
singleton :: Load r ix e => e -> Array r ix emassiv Data.Massiv.Array Create an Array with a single element.
Examples
>>> import Data.Massiv.Array as A >>> singleton 7 :: Array D Ix4 Double Array D Seq (Sz (1 :> 1 :> 1 :. 1)) [ [ [ [ 7.0 ] ] ] ]
Instead of specifying type signature we could use TypeApplications>>> :set -XTypeApplications >>> singleton @U @Ix4 @Double 7 Array U Seq (Sz (1 :> 1 :> 1 :. 1)) [ [ [ [ 7.0 ] ] ] ]
singleton :: Load r ix e => e -> Array r ix emassiv Data.Massiv.Vector Create an Array with a single element.
Examples
>>> import Data.Massiv.Array as A >>> singleton 7 :: Array D Ix4 Double Array D Seq (Sz (1 :> 1 :> 1 :. 1)) [ [ [ [ 7.0 ] ] ] ]
Instead of specifying type signature we could use TypeApplications>>> :set -XTypeApplications >>> singleton @U @Ix4 @Double 7 Array U Seq (Sz (1 :> 1 :> 1 :. 1)) [ [ [ [ 7.0 ] ] ] ]
singleton :: Hashable k => k -> v -> InsOrdHashMap k vopenapi3 Data.HashMap.Strict.InsOrd.Compat No documentation available.
singleton :: forall instr a (m :: Type -> Type) . instr a -> ProgramT instr m aoperational Control.Monad.Operational Program made from a single primitive instruction.
singleton :: (k, v) -> OMap k vordered-containers Data.Map.Ordered No documentation available.
singleton :: (k, v) -> OMap k vordered-containers Data.Map.Ordered.Strict No documentation available.
-
ordered-containers Data.Set.Ordered No documentation available.
singleton :: a -> IORef (Weak b) -> (b -> IO ()) -> IO (WeakBag a, WeakBagTicket)reflex Data.WeakBag Create a WeakBag with one item; equivalent to creating the WeakBag with empty, then using insert.
-
text-show TextShow O(1). A Builder taking a single character, satisfying
toLazyText (singleton c) = singleton c