futhark-0.9.1: An optimising compiler for a functional, array-oriented language.

Safe HaskellNone
LanguageHaskell2010

Futhark.Optimise.MemoryBlockMerging.Miscellaneous

Description

Miscellaneous helper functions. Perpetually in need of a cleanup.

Documentation

makeCommutativeMap :: Ord v => Map v (Set v) -> Map v (Set v) Source #

insertOrUpdate :: (Ord k, Ord v) => k -> v -> Map k (Set v) -> Map k (Set v) Source #

insertOrUpdateMany :: (Ord k, Ord v) => k -> Set v -> Map k (Set v) -> Map k (Set v) Source #

insertOrNew :: Ord a => Set a -> Maybe (Set a) -> Maybe (Set a) Source #

removeEmptyMaps :: Map k (Set v) -> Map k (Set v) Source #

removeKeyFromMapElems :: Ord k => Map k (Set k) -> Map k (Set k) Source #

lookupEmptyable :: (Ord a, Monoid b) => a -> Map a b -> b Source #

maybeFromBoolM :: Monad m => (a -> m Bool) -> a -> m (Maybe a) Source #

sortByKeyM :: (Ord t, Monad m) => (a -> m t) -> [a] -> m [a] Source #

mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b] Source #

anyM :: Monad m => (a -> m Bool) -> [a] -> m Bool Source #

whenM :: Monad m => m Bool -> m () -> m () Source #

mapFromListSetUnion :: (Ord k, Ord v) => [(k, Set v)] -> Map k (Set v) Source #

fixpointIterateMay :: (a -> Maybe a) -> a -> a Source #

filterSetM :: (Ord a, Monad m) => (a -> m Bool) -> Set a -> m (Set a) Source #

(<&&>) :: Monad m => m Bool -> m Bool -> m Bool Source #

(<||>) :: Monad m => m Bool -> m Bool -> m Bool Source #

expandWithAliases :: forall v. Ord v => MemAliases -> Map v Names -> Map v Names Source #

fullMapExpM :: (FullMap lore, Monad m) => Mapper lore lore m -> KernelMapper InKernel InKernel m -> Exp lore -> m (Exp lore) Source #