Hoogle Search

Within LTS Haskell 24.28 (ghc-9.10.3)

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

  1. mapMaybe :: (Unboxable a, Unboxable b) => (a -> Maybe b) -> Vector a -> Vector b

    unboxing-vector Data.Vector.Unboxing

    No documentation available.

  2. mapOf :: Typeable x => UnjsonDef x -> UnjsonDef (LazyKeyMap x)

    unjson Data.Unjson

    Gather all keys with respective values in a map. Example:

    data X = X { xMap :: LazyHashMap.HashMap Text.Text x }
    
    objectOf $ pure X
    <*> fieldBy "xmap" xMap
    "Map string to Y value"
    (mapOf unjsonY)
    
    Note that overloading allows for automatic conversion to more map types, for example:
    data X = X { xMap :: Map.Map String x }
    
    objectOf $ pure X
    <*> field "xmap" xMap
    "Map string to Y value"
    

  3. mapOn :: forall a b (xs :: [Type]) (ys :: [Type]) . Mappable a b xs ys => (a -> b) -> Vary xs -> Vary ys

    vary Vary

    Run a function on one of the variant's possibilities, keeping all other possibilities the same. This is the generalization of functions like Either's mapLeft and mapRight. If you want to map a polymorphic function like show which could match more than one possibility, use a TypeApplication to specify the desired possibility to match:

    >>> :{
    (Vary.from @Int 42           :: Vary [Int, Bool] )
    & Vary.mapOn @Bool show    -- Vary [Int, String]
    & Vary.mapOn @Int show     -- Vary [String, String]
    :}
    Vary.from @[Char] "42"
    
    If you end up with a variant with multiple duplicate possibilities, use morph to join them:
    >>> :{
    (Vary.from True                :: Vary [Char, Int, Bool])
    & Vary.mapOn @Bool show      -- Vary [Char, Int, String]
    & Vary.mapOn @Int show       -- Vary [Char, String, String]
    & Vary.mapOn @Char show      -- Vary [String, String, String]
    & Vary.morph @'[String]       -- Vary '[String]
    & Vary.intoOnly              -- String
    :}
    "True"
    

  4. mapLeft :: forall (xs :: [Type]) (ys :: [Type]) a . (Vary xs -> Vary ys) -> VEither xs a -> VEither ys a

    vary Vary.VEither

    Map a function over the VEither if it contains a VLeft, otherwise leave it alone. See also VEither.mapLeftOn, VEither.mapRight and VEither.veither.

  5. mapLeftOn :: forall x y (xs :: [Type]) (ys :: [Type]) a . Mappable x y xs ys => (x -> y) -> VEither xs a -> VEither ys a

    vary Vary.VEither

    Map a function over one of the error values inside the VEither. Any other VLeft and also VRight are kept untouched. Similar to Vary.mapOn.

  6. mapRight :: forall x y (errs :: [Type]) . (x -> y) -> VEither errs x -> VEither errs y

    vary Vary.VEither

    Map a function over the VEither if it contains a VRight, otherwise leave it alone. Exists for symmetry with VEither.mapLeft and VEither.mapLeftOn. Indeed, it is just another name for fmap. See also VEither.veither.

  7. mapOutput :: forall (m :: Type -> Type) a b t c . Monad m => VarT m a (b -> t) -> SplineT a b m c -> SplineT a t m c

    varying Control.Varying.Spline

    Map the output value of a spline.

    >>> :{
    let s = mapOutput (pure show) $ step 1 >> step 2 >> step 3
    in testVarOver (outputStream s "") [(),(),()]
    
    >>> :}
    "1"
    "2"
    "3"
    

  8. mapWithVec :: VecEach s t a b => (forall (n :: Nat) . SNatI n => Vec n a -> Vec n b) -> s -> t

    vec Data.Vec.Lazy

    No documentation available.

  9. mapWithVec :: VecEach s t a b => (forall (n :: Nat) . SNatI n => Vec n a -> Vec n b) -> s -> t

    vec Data.Vec.Lazy.Inline

    No documentation available.

  10. mapG :: (GrpFunctor f, Eq b, Group b) => (a -> b) -> f a -> f b

    vessel Tutorial

    No documentation available.

Page 325 of many | Previous | Next