Hoogle Search

Within LTS Haskell 24.28 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. reverse :: [a] -> [a]

    ihaskell IHaskellPrelude

    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 *
    

  2. reverse :: [a] -> [a]

    incipit-base Incipit.Base

    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 *
    

  3. reverse :: Boundary PitchChannel v -> Maybe (Boundary PitchChannel v)

    reactive-midyim Reactive.Banana.MIDI.Note

    Swap order of keys. Non-note events are returned without modification. If by reversing a note leaves the range of representable MIDI notes, then we return Nothing.

  4. reverse :: SymVal a => SList a -> SList a

    sbv Data.SBV.List

    reverse s reverses the sequence. NB. We can define reverse in terms of foldl as: foldl (soFar elt -> singleton elt ++ soFar) [] But in my experiments, I found that this definition performs worse instead of the recursive definition SBV generates for reverse calls. So we're keeping it intact.

    >>> sat $ \(l :: SList Integer) -> reverse l .== literal [3, 2, 1]
    Satisfiable. Model:
    s0 = [1,2,3] :: [Integer]
    
    >>> prove $ \(l :: SList Word32) -> reverse l .== [] .<=> null l
    Q.E.D.
    

  5. reverse :: SString -> SString

    sbv Data.SBV.String

    reverse s reverses the string. >>> sat $ s -> reverse s .== "abc" Satisfiable. Model: s0 = "cba" :: String >>> prove $ s -> reverse s .== "" .= null s Q.E.D.

  6. reverse :: forall (m :: Type -> Type) a . Monad m => Stream m a -> Stream m a

    streamly-core Streamly.Data.Stream

    Returns the elements of the stream in reverse order. The stream must be finite. Note that this necessarily buffers the entire stream in memory. Definition:

    >>> reverse m = Stream.concatEffect $ Stream.fold Fold.toListRev m >>= return . Stream.fromList
    

  7. reverse :: forall (m :: Type -> Type) a . StreamK m a -> StreamK m a

    streamly-core Streamly.Data.StreamK

    No documentation available.

  8. reverse :: (MonadIO m, Unbox a) => MutArray a -> m ()

    streamly-core Streamly.Internal.Data.MutArray

    You may not need to reverse an array because you can consume it in reverse using readerRev. To reverse large arrays you can read in reverse and write to another array. However, in-place reverse can be useful to take adavantage of cache locality and when you do not want to allocate additional memory.

  9. reverse :: forall (m :: Type -> Type) a . Monad m => Stream m a -> Stream m a

    streamly-core Streamly.Internal.Data.Stream

    Returns the elements of the stream in reverse order. The stream must be finite. Note that this necessarily buffers the entire stream in memory. Definition:

    >>> reverse m = Stream.concatEffect $ Stream.fold Fold.toListRev m >>= return . Stream.fromList
    

  10. reverse :: forall (m :: Type -> Type) a . StreamK m a -> StreamK m a

    streamly-core Streamly.Internal.Data.StreamK

    No documentation available.

Page 14 of many | Previous | Next