Hoogle Search
Within LTS Haskell 24.12 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
http-types Network.HTTP.Types.Header _last :: Snoc s s a a => Traversal' s alens Control.Lens.Combinators A Traversal reading and writing to the last element of a non-empty container.
>>> [a,b,c]^?!_last c
>>> []^?_last Nothing
>>> [a,b,c] & _last %~ f [a,b,f c]
>>> [1,2]^?_last Just 2
>>> [] & _last .~ 1 []
>>> [0] & _last .~ 2 [2]
>>> [0,1] & _last .~ 2 [0,2]
This Traversal is not limited to lists, however. We can also work with other containers, such as a Vector.>>> Vector.fromList "abcde" ^? _last Just 'e'
>>> Vector.empty ^? _last Nothing
>>> (Vector.fromList "abcde" & _last .~ 'Q') == Vector.fromList "abcdQ" True
_last :: Traversal' [a] a _last :: Traversal' (Seq a) a _last :: Traversal' (Vector a) a
_last :: Snoc s s a a => Traversal' s alens Control.Lens.Cons A Traversal reading and writing to the last element of a non-empty container.
>>> [a,b,c]^?!_last c
>>> []^?_last Nothing
>>> [a,b,c] & _last %~ f [a,b,f c]
>>> [1,2]^?_last Just 2
>>> [] & _last .~ 1 []
>>> [0] & _last .~ 2 [2]
>>> [0,1] & _last .~ 2 [0,2]
This Traversal is not limited to lists, however. We can also work with other containers, such as a Vector.>>> Vector.fromList "abcde" ^? _last Just 'e'
>>> Vector.empty ^? _last Nothing
>>> (Vector.fromList "abcde" & _last .~ 'Q') == Vector.fromList "abcdQ" True
_last :: Traversal' [a] a _last :: Traversal' (Seq a) a _last :: Traversal' (Vector a) a
-
test-framework Test.Framework.Providers.API No documentation available.
improvingLast :: (a :~> b) -> btest-framework Test.Framework.Providers.API No documentation available.
listToMaybeLast :: [a] -> Maybe atest-framework Test.Framework.Providers.API No documentation available.
cookie_last_access_time :: Cookie -> UTCTimehttp-client Network.HTTP.Client No documentation available.
cookie_last_access_time :: Cookie -> UTCTimehttp-client Network.HTTP.Client.Internal No documentation available.
_last :: Snoc s s a a => Traversal' s amicrolens Lens.Micro _last gives you access to the last element of the list:
>>> "Hello." ^? _last '.'
See documentation for _head, as _last and _head are pretty similar.-
base-compat Data.Monoid.Compat No documentation available.