Hoogle Search
Within LTS Haskell 24.2 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
relude Relude.Monoid Maybe monoid returning the rightmost non-Nothing value. Last a is isomorphic to Dual (First a), and thus to Dual (Alt Maybe a) Data.Semigroup.Last. The former returns the last non-Nothing, so x <> Data.Monoid.Last Nothing = x. The latter simply returns the last value, thus x <> Data.Semigroup.Last Nothing = Data.Semigroup.Last Nothing.
Examples
>>> Last (Just "hello") <> Last Nothing <> Last (Just "world") Last {getLast = Just "world"}
>>> Last Nothing <> mempty Last {getLast = Nothing}
-
relude Relude.Monoid No documentation available.
data
Last (b :: [a]) (c :: Maybe a)first-class-families Fcf.Data.List No documentation available.
-
base-compat-batteries Data.Monoid.Compat Maybe monoid returning the rightmost non-Nothing value. Last a is isomorphic to Dual (First a), and thus to Dual (Alt Maybe a) Data.Semigroup.Last. The former returns the last non-Nothing, so x <> Data.Monoid.Last Nothing = x. The latter simply returns the last value, thus x <> Data.Semigroup.Last Nothing = Data.Semigroup.Last Nothing.
Examples
>>> Last (Just "hello") <> Last Nothing <> Last (Just "world") Last {getLast = Just "world"}
>>> Last Nothing <> mempty Last {getLast = Nothing}
-
base-compat-batteries Data.Monoid.Compat No documentation available.
-
base-compat-batteries Data.Semigroup.Compat Beware that Data.Semigroup.Last is different from Data.Monoid.Last. The former simply returns the last value, so x <> Data.Semigroup.Last Nothing = Data.Semigroup.Last Nothing. The latter returns the last non-Nothing, thus x <> Data.Monoid.Last Nothing = x.
Examples
>>> Last 0 <> Last 10 Last {getLast = 10}
>>> sconcat $ Last 1 :| [ Last n | n <- [2..]] Last {getLast = * hangs forever *
-
base-compat-batteries Data.Semigroup.Compat No documentation available.
type family
Last (a1 :: NonEmpty a) :: asingletons-base Data.List.NonEmpty.Singletons No documentation available.
type family
Last (a1 :: [a]) :: asingletons-base Data.List.Singletons No documentation available.
type family
Last (a1 :: [a]) :: asingletons-base Prelude.Singletons No documentation available.