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.

  1. _head :: Cons s s a a => Traversal' s a

    lens 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
    

  2. _head :: Cons s s a a => Traversal' s a

    lens 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
    

  3. typeFamilyHeadInjectivityAnn :: Lens' TypeFamilyHead (Maybe InjectivityAnn)

    lens Language.Haskell.TH.Lens

    No documentation available.

  4. typeFamilyHeadName :: Lens' TypeFamilyHead Name

    lens Language.Haskell.TH.Lens

    No documentation available.

  5. typeFamilyHeadResultSig :: Lens' TypeFamilyHead FamilyResultSig

    lens Language.Haskell.TH.Lens

    No documentation available.

  6. typeFamilyHeadTyVarBndrs :: Lens' TypeFamilyHead [TyVarBndrVis]

    lens Language.Haskell.TH.Lens

    No documentation available.

  7. lookAhead :: forall s (m :: Type -> Type) t u a . Stream s m t => ParsecT s u m a -> ParsecT s u m a

    parsec 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.

  8. lookAhead :: forall s (m :: Type -> Type) t u a . Stream s m t => ParsecT s u m a -> ParsecT s u m a

    parsec 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.

  9. lookAhead :: forall s (m :: Type -> Type) t u a . Stream s m t => ParsecT s u m a -> ParsecT s u m a

    parsec 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.

  10. lookAhead :: forall s (m :: Type -> Type) t u a . Stream s m t => ParsecT s u m a -> ParsecT s u m a

    parsec 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.

Page 130 of many | Previous | Next