Hoogle Search
Within LTS Haskell 24.45 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
fromMap :: MonoidNull v => Map k v -> MonoidMap k vmonoidmap Data.MonoidMap Constructs a MonoidMap from an ordinary Map. Satisfies the following property for all possible keys k:
get k (fromMap m) == Map.findWithDefault mempty k m
This function performs canonicalisation of null values, and has a time complexity that is linear in the size of the map.fromMapWith :: MonoidNull v2 => (v1 -> v2) -> Map k v1 -> MonoidMap k v2monoidmap Data.MonoidMap Constructs a MonoidMap from an ordinary Map, applying the given function to all values. Satisfies the following property for all possible keys k:
get k (fromMapWith f m) == maybe mempty f (Map.lookup k m)
This function performs canonicalisation of null values, and has a time complexity that is linear in the size of the map.isSubmapOf :: (Ord k, Monoid v, Reductive v) => MonoidMap k v -> MonoidMap k v -> Boolmonoidmap Data.MonoidMap Indicates whether or not the first map is a submap of the second. Map m1 is a submap of map m2 if (and only if) m1 can be subtracted from m2 with the minusMaybe operation:
m1 `isSubmapOf` m2 == isJust (m2 `minusMaybe` m1)
Equivalently, map m1 is a submap of map m2 if (and only if) for all possible keys k, the value for k in m1 can be subtracted from the value for k in m2 with the (</>) operator:m1 `isSubmapOf` m2 == (∀ k. isJust (get k m2 </> get k m1))
-
monoidmap Data.MonoidMap Indicates whether or not the first map is a submap of the second, using the given function to compare values for matching keys. Satisfies the following property:
isSubmapOfBy f m1 m2 == all (\k -> f (get k m1) (get k m2)) (nonNullKeys m1)
Conditional totality
If the given comparison function f always evaluates to True when its first argument is mempty:∀ v. f mempty v
Then the following property holds:isSubmapOfBy f m1 m2 == (∀ k. f (get k m1) (get k m2))
toMap :: MonoidMap k v -> Map k vmonoidmap Data.MonoidMap Converts a MonoidMap to an ordinary Map. The result only includes entries with values that are not null. Satisfies the following round-trip property:
fromMap (toMap m) == m
-
morpheus-graphql-app Data.Morpheus.App.Internal.Resolving No documentation available.
queryResolverMap :: RootResolverValue e (m :: Type -> Type) -> ResolverMap (Resolver QUERY e m)morpheus-graphql-app Data.Morpheus.App.Internal.Resolving No documentation available.
concatMap :: (a -> NonEmptyVector b) -> NonEmptyVector a -> NonEmptyVector bnonempty-vector Data.Vector.NonEmpty Map a function over a vector and concatenate the results.
>>> concatMap (\a -> unsafeFromList [a,a]) (unsafeFromList [1,2,3]) [1,1,2,2,3,3]
imap :: (Int -> a -> b) -> NonEmptyVector a -> NonEmptyVector bnonempty-vector Data.Vector.NonEmpty O(n) Apply a function to every element of a non-empty vector and its index.
>>> imap (\i a -> if i == 2 then a+1 else a+0) $ unsafeFromList [1..3] [1,2,4]
imapM :: Monad m => (Int -> a -> m b) -> NonEmptyVector a -> m (NonEmptyVector b)nonempty-vector Data.Vector.NonEmpty O(n) Apply the monadic action to every element of a non-empty vector and its index, yielding a non-empty vector of results.
>>> imapM (\i a -> if i == 1 then Just a else Just 0) (unsafeFromList [1..3]) Just [0,2,0]
>>> imapM (\_ _ -> Nothing) (unsafeFromList [1..3]) Nothing