cons package:diagrams-lib

cons an element onto a container.
>>> cons a []
[a]
>>> cons a [b, c]
[a,b,c]
>>> cons a (Seq.fromList [])
fromList [a]
>>> cons a (Seq.fromList [b, c])
fromList [a,b,c]
This class provides a way to attach or detach elements on the left side of a structure in a flexible manner.
The Const functor.
_Cons :: Prism [a] [b] (a, [a]) (b, [b])
_Cons :: Prism (Seq a) (Seq b) (a, Seq a) (b, Seq b)
_Cons :: Prism (Vector a) (Vector b) (a, Vector a) (b, Vector b)
_Cons :: Prism' String (Char, String)
_Cons :: Prism' Text (Char, Text)
_Cons :: Prism' ByteString (Word8, ByteString)
Attempt to extract the left-most element from a container, and a version of the container without that element.
>>> uncons []
Nothing
>>> uncons [a, b, c]
Just (a,[b,c])