Hoogle Search
Within LTS Haskell 24.58 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
_head :: Cons s s a a => Traversal' s alens Control.Lens.Combinators A Traversal reading and writing to the head of a non-empty container.
>>> [a,b,c]^? _head Just a
>>> [a,b,c] & _head .~ d [d,b,c]
>>> [a,b,c] & _head %~ f [f a,b,c]
>>> [] & _head %~ f []
>>> [1,2,3]^?!_head 1
>>> []^?_head Nothing
>>> [1,2]^?_head Just 1
>>> [] & _head .~ 1 []
>>> [0] & _head .~ 2 [2]
>>> [0,1] & _head .~ 2 [2,1]
This isn't limited to lists. For instance you can also traverse the head of a Seq:>>> Seq.fromList [a,b,c,d] & _head %~ f fromList [f a,b,c,d]
>>> Seq.fromList [] ^? _head Nothing
>>> Seq.fromList [a,b,c,d] ^? _head Just a
_head :: Traversal' [a] a _head :: Traversal' (Seq a) a _head :: Traversal' (Vector a) a
_head :: Cons s s a a => Traversal' s alens Control.Lens.Cons A Traversal reading and writing to the head of a non-empty container.
>>> [a,b,c]^? _head Just a
>>> [a,b,c] & _head .~ d [d,b,c]
>>> [a,b,c] & _head %~ f [f a,b,c]
>>> [] & _head %~ f []
>>> [1,2,3]^?!_head 1
>>> []^?_head Nothing
>>> [1,2]^?_head Just 1
>>> [] & _head .~ 1 []
>>> [0] & _head .~ 2 [2]
>>> [0,1] & _head .~ 2 [2,1]
This isn't limited to lists. For instance you can also traverse the head of a Seq:>>> Seq.fromList [a,b,c,d] & _head %~ f fromList [f a,b,c,d]
>>> Seq.fromList [] ^? _head Nothing
>>> Seq.fromList [a,b,c,d] ^? _head Just a
_head :: Traversal' [a] a _head :: Traversal' (Seq a) a _head :: Traversal' (Vector a) a
typeFamilyHeadInjectivityAnn :: Lens' TypeFamilyHead (Maybe InjectivityAnn)lens Language.Haskell.TH.Lens No documentation available.
typeFamilyHeadName :: Lens' TypeFamilyHead Namelens Language.Haskell.TH.Lens No documentation available.
typeFamilyHeadResultSig :: Lens' TypeFamilyHead FamilyResultSiglens Language.Haskell.TH.Lens No documentation available.
typeFamilyHeadTyVarBndrs :: Lens' TypeFamilyHead [TyVarBndrVis]lens Language.Haskell.TH.Lens No documentation available.
lookAhead :: forall s (m :: Type -> Type) t u a . Stream s m t => ParsecT s u m a -> ParsecT s u m aparsec Text.Parsec lookAhead p parses p without consuming any input. If p fails and consumes some input, so does lookAhead. Combine with try if this is undesirable.
lookAhead :: forall s (m :: Type -> Type) t u a . Stream s m t => ParsecT s u m a -> ParsecT s u m aparsec Text.Parsec.Combinator lookAhead p parses p without consuming any input. If p fails and consumes some input, so does lookAhead. Combine with try if this is undesirable.
lookAhead :: forall s (m :: Type -> Type) t u a . Stream s m t => ParsecT s u m a -> ParsecT s u m aparsec Text.Parsec.Prim lookAhead p parses p without consuming any input. If p fails and consumes some input, so does lookAhead. Combine with try if this is undesirable.
lookAhead :: forall s (m :: Type -> Type) t u a . Stream s m t => ParsecT s u m a -> ParsecT s u m aparsec Text.ParserCombinators.Parsec.Combinator lookAhead p parses p without consuming any input. If p fails and consumes some input, so does lookAhead. Combine with try if this is undesirable.