Hoogle Search

Within LTS Haskell 24.51 (ghc-9.10.3)

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

  1. class HasMaybeLength e

    elynx-tree ELynx.Tree.Length

    Class of data types that may have a length.

  2. getMaybeLength :: HasMaybeLength e => e -> Maybe Length

    elynx-tree ELynx.Tree.Length

    No documentation available.

  3. class HasMaybeSupport e

    elynx-tree ELynx.Tree.Support

    Class of data types that may have a support value.

  4. getMaybeSupport :: HasMaybeSupport e => e -> Maybe Support

    elynx-tree ELynx.Tree.Support

    No documentation available.

  5. toMaybe :: Process e a -> Maybe e

    ghc-events GHC.RTS.Events.Analysis

    No documentation available.

  6. fetchMaybe :: (HasCallStack, MonadDB m, MonadThrow m, FromRow row) => (row -> t) -> m (Maybe t)

    hpqtypes Database.PostgreSQL.PQTypes.Fold

    Specialization of foldlDB that fetches one or zero rows. If more rows are delivered, AffectedRowsMismatch exception is thrown.

  7. tMaybe :: T t -> T (Maybe t)

    mixed-types-num Numeric.MixedTypes.Literals

    No documentation available.

  8. tMaybeBool :: T (Maybe Bool)

    mixed-types-num Numeric.MixedTypes.Literals

    No documentation available.

  9. tMaybeMaybeBool :: T (Maybe (Maybe Bool))

    mixed-types-num Numeric.MixedTypes.Literals

    No documentation available.

  10. minusMaybe :: (Ord k, MonoidNull v, Reductive v) => MonoidMap k v -> MonoidMap k v -> Maybe (MonoidMap k v)

    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
    

Page 234 of many | Previous | Next