-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
substitute :: Monad f => Eq a => a -> f a -> f a -> f a
substitute = substituteOf . (==)
substituteBy :: Monad m => (a -> Bool) -> m a -> m a -> m a
substituteBy old new as = do
a <- as
if old a
then new
else pure asubstituteVar :: Functor f => Eq a => a -> a -> f a -> f a
substituteVar = substituteVarOf . (==)
substituteVarBy :: Functor f => (a -> Bool) -> a -> f a -> f a
substituteVarBy old new as = do
a <- as
pure
if old a
then new
else aIs there a use for this?
Metadata
Metadata
Assignees
Labels
No labels