base-compat-0.13.1: A compatibility layer for base
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Function.Compat

Synopsis

Documentation

(&) :: a -> (a -> b) -> b #

applyWhen :: Bool -> (a -> a) -> a -> a Source #

applyWhen applies a function to a value if a condition is true, otherwise, it returns the value unchanged.

It is equivalent to flip (bool id).

Algebraic properties:

Since: 4.18.0.0