Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type Stack a = OSet a
- fromList :: Ord a => [a] -> Stack a
- head :: Stack a -> a
- empty :: Stack a
- tail :: Ord a => Stack a -> [a]
- last :: Stack a -> a
- insert :: Ord a => a -> Stack a -> Stack a
- singleton :: a -> Stack a
- size :: Stack a -> Int
- elemAt :: Stack a -> Int -> Maybe a
- removeLast :: Ord a => Stack a -> Stack a
- unsafeElemAt :: Stack a -> Int -> a
- safeHead :: Stack a -> Maybe a
- pop :: Ord a => Stack a -> Stack a
- popWithInfo :: Ord a => Stack a -> (Stack a, a, a)
- takeStack :: Ord a => Int -> Stack a -> Stack a
- toList :: Foldable t => t a -> [a]
Documentation
unsafeElemAt :: Stack a -> Int -> a Source #
toList :: Foldable t => t a -> [a] #
List of elements of a structure, from left to right. If the entire list is intended to be reduced via a fold, just fold the structure directly bypassing the list.
Examples
Basic usage:
>>>
toList Nothing
[]
>>>
toList (Just 42)
[42]
>>>
toList (Left "foo")
[]
>>>
toList (Node (Leaf 5) 17 (Node Empty 12 (Leaf 8)))
[5,17,12,8]
For lists, toList
is the identity:
>>>
toList [1, 2, 3]
[1,2,3]
Since: base-4.8.0.0