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.
-
ihaskell IHaskellPrelude No documentation available.
-
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]
-
incipit-base Incipit.List Return Just the head of a list.
-
incipit-base Incipit.List Return Just the last element of a list.
-
liquid-fixpoint Language.Fixpoint.Misc No documentation available.
singleListToJust :: [a] -> Maybe apolysemy-plugin Polysemy.Plugin.Fundep.Utils Returns the head of the list iff there is exactly one element.
-
Agda Agda.Utils.List Last element (safe). O(n).
-
fuzzyset Data.FuzzySet.Utils No documentation available.
-
yeshql-core Database.YeshQL.Util No documentation available.
-
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]