Safe Haskell | None |
---|---|
Language | Haskell2010 |
Typeclass for creating structures from singleton element.
Documentation
Type class for types that can be created from one element. singleton
is lone name for this function. Constructions of different type differ:
:[]
for lists, two arguments for Maps. Also some data types are monomorphic.
>>>
one True :: [Bool]
[True]>>>
one 'a' :: Text
"a">>>
one (3, "hello") :: HashMap Int String
fromList [(3,"hello")]
Instances
One ByteString Source # | |
Defined in Relude.Container.One type OneItem ByteString :: * Source # one :: OneItem ByteString -> ByteString Source # | |
One ByteString Source # | |
Defined in Relude.Container.One type OneItem ByteString :: * Source # one :: OneItem ByteString -> ByteString Source # | |
One IntSet Source # | |
One Text Source # | |
One Text Source # | |
One [a] Source # | |
One (NonEmpty a) Source # | |
One (IntMap v) Source # | |
One (Seq a) Source # | |
One (Set v) Source # | |
Hashable v => One (HashSet v) Source # | |
One (Map k v) Source # | |
Hashable k => One (HashMap k v) Source # | |