agda-unused-0.1.0: Check for unused code in an Agda project.
Safe HaskellSafe
LanguageHaskell2010

Agda.Unused.Utils

Description

Utility functions for Maybe, Either, and Map types.

Synopsis

Maybe

liftMaybe :: MonadError e m => e -> Maybe a -> m a Source #

Lift a Maybe type to an error monad by throwing a fixed error.

Either

mapLeft :: (e -> f) -> Either e a -> Either f a Source #

Map the left component of an Either type.

List

stripSuffix :: Eq a => [a] -> [a] -> Maybe [a] Source #

Drop the given suffix from a list.

Map

mapDeletes :: Ord k => [k] -> Map k a -> Map k a Source #

Delete a list of keys from a map.

mapUpdateKey :: Ord k => k -> k -> Map k a -> Map k a Source #

Modify a key of a map.

  • If the source key is not present, do nothing.
  • If the target key is already present, overwrite it.