Hoogle Search

Within LTS Haskell 24.20 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. (<<.>~) :: LensLike ((,) FilePath) s a FilePath FilePath -> String -> s -> (FilePath, a)

    lens System.FilePath.Lens

    Add an extension onto the end of the target of a Lens and return the result

    >>> _1 <<.>~ "txt" $ ("hello","world")
    ("hello.txt",("hello.txt","world"))
    
    When you do not need the result of the operation, (<.>~) is more flexible.

  2. (<<<.>=) :: MonadState s m => LensLike' ((,) FilePath) s FilePath -> String -> m FilePath

    lens System.FilePath.Lens

    Add an extension onto the end of the target of a Lens into your monad's state and return the old value.

    >>> runState (_1 <<<.>= "txt") ("hello","world")
    ("hello",("hello.txt","world"))
    
    When you do not need the old value, (<.>=) is more flexible.

  3. (<<<.>~) :: Optical' (->) q ((,) FilePath) s FilePath -> String -> q s (FilePath, s)

    lens System.FilePath.Lens

    Add an extension onto the end of the target of a Lens but return the old value

    >>> _1 <<<.>~ "txt" $ ("hello","world")
    ("hello",("hello.txt","world"))
    
    When you do not need the old value, (<.>~) is more flexible.

  4. (^.) :: s -> Getting a s a -> a

    gogol-core Gogol.Prelude

    View the value pointed to by a Getter or Lens or the result of folding over all the results of a Fold or Traversal that points at a monoidal values. This is the same operation as view with the arguments flipped. The fixity and semantics are such that subsequent field accesses can be performed with (.).

    >>> (a,b)^._2
    b
    
    >>> ("hello","world")^._2
    "world"
    
    >>> import Data.Complex
    
    >>> ((0, 1 :+ 2), 3)^._1._2.to magnitude
    2.23606797749979
    
    (^.) ::             s -> Getter s a     -> a
    (^.) :: Monoid m => s -> Fold s m       -> m
    (^.) ::             s -> Iso' s a       -> a
    (^.) ::             s -> Lens' s a      -> a
    (^.) :: Monoid m => s -> Traversal' s m -> m
    

  5. (:.) :: forall a (n1 :: Nat) . a -> Vec n1 a -> Vec ('S n1) a

    hedgehog Hedgehog.Internal.Gen

    No documentation available.

  6. (<<.~) :: LensLike ((,) a) s t a b -> b -> s -> (a, t)

    microlens Lens.Micro

    This is a version of (.~) which modifies the structure and returns it along with the old value:

    >>> (1, 2) & _1 <<.~ 0
    (1, (0, 2))
    
    Simpler type signatures:
    (<<.~) ::             Lens s t a b      -> b -> s -> (a, t)
    (<<.~) :: Monoid a => Traversal s t a b -> b -> s -> (a, t)
    

  7. (^.) :: s -> Getting a s a -> a

    microlens Lens.Micro

    (^.) applies a getter to a value; in other words, it gets a value out of a structure using a getter (which can be a lens, traversal, fold, etc.). Getting 1st field of a tuple:

    (^. _1) :: (a, b) -> a
    (^. _1) = fst
    
    When (^.) is used with a traversal, it combines all results using the Monoid instance for the resulting type. For instance, for lists it would be simple concatenation:
    >>> ("str","ing") ^. each
    "string"
    
    The reason for this is that traversals use Applicative, and the Applicative instance for Const uses monoid concatenation to combine “effects” of Const. A non-operator version of (^.) is called view, and it's a bit more general than (^.) (it works in MonadReader). If you need the general version, you can get it from microlens-mtl; otherwise there's view available in Lens.Micro.Extras.

  8. (^..) :: s -> Getting (Endo [a]) s a -> [a]

    microlens Lens.Micro

    s ^.. t returns the list of all values that t gets from s. A Maybe contains either 0 or 1 values:

    >>> Just 3 ^.. _Just
    [3]
    
    Gathering all values in a list of tuples:
    >>> [(1,2),(3,4)] ^.. each.each
    [1,2,3,4]
    

  9. ( #. ) :: Coercible c b => (b -> c) -> (a -> b) -> a -> c

    microlens Lens.Micro.Internal

    No documentation available.

  10. ( #. ) :: forall a b c q . (Profunctor p, Coercible c b) => q b c -> p a b -> p a c

    profunctors Data.Profunctor.Unsafe

    Strictly map the second argument argument covariantly with a function that is assumed operationally to be a cast, such as a newtype constructor. Note: This operation is explicitly unsafe since an implementation may choose to use unsafeCoerce to implement this combinator and it has no way to validate that your function meets the requirements. If you implement this combinator with unsafeCoerce, then you are taking upon yourself the obligation that you don't use GADT-like tricks to distinguish values. If you import Data.Profunctor.Unsafe you are taking upon yourself the obligation that you will only call this with a first argument that is operationally identity. The semantics of this function with respect to bottoms should match the default definition:

    (#.) ≡ \_ -> \p -> p `seq` rmap coerce p
    

Page 101 of many | Previous | Next