Hoogle Search
Within LTS Haskell 24.38 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
mixed-types-num Numeric.MixedTypes.Literals No documentation available.
-
mixed-types-num Numeric.MixedTypes.Literals No documentation available.
tMaybeMaybeBool :: T (Maybe (Maybe Bool))mixed-types-num Numeric.MixedTypes.Literals No documentation available.
-
monoidmap Data.MonoidMap Performs reductive subtraction of the second map from the first. Uses the Reductive subtraction operator (</>) to subtract each value in the second map from its matching value in the first map. This function produces a result if (and only if) for all possible keys k, it is possible to subtract the value for k in the second map from the value for k in the first map:
isJust (m1 `minusMaybe` m2) == (∀ k. isJust (get k m1 </> get k m2))
Otherwise, this function returns Nothing. This function satisfies the following property:all (\r -> Just (get k r) == get k m1 </> get k m2) (m1 `minusMaybe` m2)
This function provides the definition of (</>) for the MonoidMap instance of Reductive.Examples
With Set Natural values, this function performs set subtraction of matching values, succeeding if (and only if) each value from the second map is a subset of its matching value from the first map:f xs = fromList (fromList <$> xs)
>>> m1 = f [("a", [0,1,2]), ("b", [0,1,2])] >>> m2 = f [("a", [ ]), ("b", [0,1,2])] >>> m3 = f [("a", [0,1,2]), ("b", [ ])]>>> m1 `minusMaybe` m2 == Just m3 True
>>> m1 = f [("a", [0,1,2]), ("b", [0,1,2]), ("c", [0,1,2])] >>> m2 = f [("a", [0 ]), ("b", [ 1 ]), ("c", [ 2])] >>> m3 = f [("a", [ 1,2]), ("b", [0, 2]), ("c", [0,1 ])]>>> m1 `minusMaybe` m2 == Just m3 True
>>> m1 = f [("a", [0,1,2 ]), ("b", [0,1,2 ]), ("c", [0,1,2 ])] >>> m2 = f [("a", [ 2,3,4]), ("b", [ 1,2,3,4]), ("c", [0,1,2,3,4])]>>> m1 `minusMaybe` m2 == Nothing True
With Sum Natural values, this function performs ordinary subtraction of matching values, succeeding if (and only if) each value from the second map is less than or equal to its matching value from the first map:>>> m1 = fromList [("a", 2), ("b", 3), ("c", 5), ("d", 8)] >>> m2 = fromList [("a", 0), ("b", 0), ("c", 0), ("d", 0)] >>> m3 = fromList [("a", 2), ("b", 3), ("c", 5), ("d", 8)]
>>> m1 `minusMaybe` m2 == Just m3 True
>>> m1 = fromList [("a", 2), ("b", 3), ("c", 5), ("d", 8)] >>> m2 = fromList [("a", 1), ("b", 2), ("c", 3), ("d", 5)] >>> m3 = fromList [("a", 1), ("b", 1), ("c", 2), ("d", 3)]
>>> m1 `minusMaybe` m2 == Just m3 True
>>> m1 = fromList [("a", 2), ("b", 3), ("c", 5), ("d", 8)] >>> m2 = fromList [("a", 2), ("b", 3), ("c", 5), ("d", 8)] >>> m3 = fromList [("a", 0), ("b", 0), ("c", 0), ("d", 0)]
>>> m1 `minusMaybe` m2 == Just m3 True
>>> m1 = fromList [("a", 2), ("b", 3), ("c", 5), ("d", 8)] >>> m2 = fromList [("a", 3), ("b", 3), ("c", 5), ("d", 8)]
>>> m1 `minusMaybe` m2 == Nothing True
imapMaybe :: (Int -> a -> Maybe b) -> NonEmptyVector a -> Vector bnonempty-vector Data.Vector.NonEmpty O(n) Drop elements when predicate, applied to index and value, returns Nothing If no elements satisfy the predicate, the resulting vector may be empty.
>>> imapMaybe (\i a -> if a == 2 || i == 2 then Nothing else Just a) (unsafeFromList [1..3]) [1]
mapMaybe :: (a -> Maybe b) -> NonEmptyVector a -> Vector bnonempty-vector Data.Vector.NonEmpty O(n) Drop elements when predicate returns Nothing If no elements satisfy the predicate, the resulting vector may be empty.
>>> mapMaybe (\a -> if a == 2 then Nothing else Just a) (unsafeFromList [1..3]) [1,3]
-
optics-extra Optics.Extra.Internal.Zoom No documentation available.
-
optics-extra Optics.Extra.Internal.Zoom No documentation available.
-
optics-extra Optics.Extra.Internal.Zoom No documentation available.
-
optics-extra Optics.Zoom No documentation available.