Hoogle Search
Within LTS Haskell 24.3 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
Cabal-syntax Distribution.Compat.Prelude No documentation available.
reverse :: Measured v a => FingerTree v a -> FingerTree v afingertree Data.FingerTree O(n). The reverse of a sequence.
reverse :: OsString -> OsStringos-string System.OsString O(n) reverse xs efficiently returns the elements of xs in reverse order.
reverse :: ShortByteString -> ShortByteStringos-string System.OsString.Data.ByteString.Short O(n) reverse xs efficiently returns the elements of xs in reverse order.
reverse :: ShortByteString -> ShortByteStringos-string System.OsString.Data.ByteString.Short.Word16 O(n) reverse xs efficiently returns the elements of xs in reverse order.
reverse :: OsString -> OsStringos-string System.OsString.Internal O(n) reverse xs efficiently returns the elements of xs in reverse order.
reverse :: PosixString -> PosixStringos-string System.OsString.Posix O(n) reverse xs efficiently returns the elements of xs in reverse order.
reverse :: WindowsString -> WindowsStringos-string System.OsString.Windows O(n) reverse xs efficiently returns the elements of xs in reverse order.
-
relude Relude.List.Reexport reverse xs returns the elements of xs in reverse order. xs must be finite.
Laziness
reverse is lazy in its elements.>>> head (reverse [undefined, 1]) 1
>>> reverse (1 : 2 : undefined) *** Exception: Prelude.undefined
Examples
>>> reverse [] []
>>> reverse [42] [42]
>>> reverse [2,5,7] [7,5,2]
>>> reverse [1..] * Hangs forever *
reverse :: YiString -> YiStringyi-rope Yi.Rope Reverse the whole underlying string. This involves reversing the order of the chunks as well as content of the chunks. We use a little optimisation here that re-uses the content of each chunk but this exposes a potential problem: after many transformations, our chunks size might become quite varied (but never more than the default size), perhaps we should periodically rechunk the tree to recover nice sizes?