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.
mapMaybe :: (Unboxable a, Unboxable b) => (a -> Maybe b) -> Vector a -> Vector bunboxing-vector Data.Vector.Unboxing No documentation available.
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"-
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" -
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.
-
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.
mapRight :: forall x y (errs :: [Type]) . (x -> y) -> VEither errs x -> VEither errs yvary 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.
-
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" mapWithVec :: VecEach s t a b => (forall (n :: Nat) . SNatI n => Vec n a -> Vec n b) -> s -> tvec Data.Vec.Lazy No documentation available.
mapWithVec :: VecEach s t a b => (forall (n :: Nat) . SNatI n => Vec n a -> Vec n b) -> s -> tvec Data.Vec.Lazy.Inline No documentation available.
mapG :: (GrpFunctor f, Eq b, Group b) => (a -> b) -> f a -> f bvessel Tutorial No documentation available.