| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Relude.Container.One
Description
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 StringfromList [(3,"hello")]
Minimal complete definition
Instances
| One ByteString # | |
Defined in Relude.Container.One Associated Types type OneItem ByteString :: * # Methods one :: OneItem ByteString -> ByteString # | |
| One ByteString # | |
Defined in Relude.Container.One Associated Types type OneItem ByteString :: * # Methods one :: OneItem ByteString -> ByteString # | |
| One IntSet # | |
| One Text # | |
| One Text # | |
| One [a] # | |
| One (NonEmpty a) # | |
| One (IntMap v) # | |
| One (Seq a) # | |
| One (Set v) # | |
| Hashable v => One (HashSet v) # | |
| One (Map k v) # | |
| Hashable k => One (HashMap k v) # | |