Hoogle Search

Within LTS Haskell 24.66 (ghc-9.10.3)

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

  1. lastMay :: [a] -> Maybe a

    ihaskell IHaskellPrelude

    No documentation available.

  2. listToMaybe :: [a] -> Maybe a

    incipit-base Incipit.Base

    The listToMaybe function returns Nothing on an empty list or Just a where a is the first element of the list.

    Examples

    Basic usage:
    >>> listToMaybe []
    Nothing
    
    >>> listToMaybe [9]
    Just 9
    
    >>> listToMaybe [1,2,3]
    Just 1
    
    Composing maybeToList with listToMaybe should be the identity on singleton/empty lists:
    >>> maybeToList $ listToMaybe [5]
    [5]
    
    >>> maybeToList $ listToMaybe []
    []
    
    But not on lists with more than one element:
    >>> maybeToList $ listToMaybe [1,2,3]
    [1]
    

  3. head :: [a] -> Maybe a

    incipit-base Incipit.List

    Return Just the head of a list.

  4. last :: [a] -> Maybe a

    incipit-base Incipit.List

    Return Just the last element of a list.

  5. headMb :: [a] -> Maybe a

    liquid-fixpoint Language.Fixpoint.Misc

    No documentation available.

  6. singleListToJust :: [a] -> Maybe a

    polysemy-plugin Polysemy.Plugin.Fundep.Utils

    Returns the head of the list iff there is exactly one element.

  7. lastMaybe :: [a] -> Maybe a

    Agda Agda.Utils.List

    Last element (safe). O(n).

  8. safeHead :: [a] -> Maybe a

    fuzzyset Data.FuzzySet.Utils

    No documentation available.

  9. headMay :: [a] -> Maybe a

    yeshql-core Database.YeshQL.Util

    No documentation available.

  10. listToMaybe :: [a] -> Maybe a

    classy-prelude-yesod ClassyPrelude.Yesod

    The listToMaybe function returns Nothing on an empty list or Just a where a is the first element of the list.

    Examples

    Basic usage:
    >>> listToMaybe []
    Nothing
    
    >>> listToMaybe [9]
    Just 9
    
    >>> listToMaybe [1,2,3]
    Just 1
    
    Composing maybeToList with listToMaybe should be the identity on singleton/empty lists:
    >>> maybeToList $ listToMaybe [5]
    [5]
    
    >>> maybeToList $ listToMaybe []
    []
    
    But not on lists with more than one element:
    >>> maybeToList $ listToMaybe [1,2,3]
    [1]
    

Page 4 of many | Previous | Next