feature-flipper-0.2.1.2: A minimally obtrusive feature flag library

Safe HaskellNone
LanguageHaskell2010

Control.Flipper

Description

 

Synopsis

Documentation

enabled :: HasFeatureFlags m => FeatureName -> m Bool Source #

The enabled function returns a Bool indicating if the queried feature is active.

When the queried FeatureName does not exists, enabled returns False.

enabledFor :: (HasFeatureFlags m, HasActorId a) => FeatureName -> a -> m Bool Source #

The enabledFor function returns a Bool indicating if the queried feature is active for the given enitty.

If the queried FeatureName does not exists, enabledFor returns False.

enable :: ModifiesFeatureFlags m => FeatureName -> m () Source #

The enable function activates a feature globally.

When the FeatureName does not exist, it is created and set to active.

enableFor :: (ModifiesFeatureFlags m, HasActorId a) => FeatureName -> a -> m () Source #

The enableFor function activates a feature for a single actor.

If the FeatureName does not exist in the store, it is created and set to active only for the given actor.

enableForPercentage :: ModifiesFeatureFlags m => FeatureName -> Percentage -> m () Source #

The enableForPercentage function activates a feature for a percentage of actors.

If the FeatureName does not exist in the store, it is created and set to active only for the specified percentage.

disable :: ModifiesFeatureFlags m => FeatureName -> m () Source #

The disable function deactivates a feature globally.

When the FeatureName does not exist, it is created and set to inactive.

toggle :: ModifiesFeatureFlags m => FeatureName -> m () Source #

The toggle function flips the current state of a feature globally.

When the FeatureName does not exist, it is created and set to True.

whenEnabled :: HasFeatureFlags m => FeatureName -> m () -> m () Source #

The whenEnabled function calls the supplied function, 'm ()', when the given FeatureName is enabled.

When the feature specified by FeatureName is disabled, 'm ()' is not evaluated.

whenEnabledFor :: (HasFeatureFlags m, HasActorId a) => FeatureName -> a -> m () -> m () Source #

The whenEnabledFor function calls the supplied function, 'm ()', when the given FeatureName is enabled for the given actor.

When the feature specified by FeatureName is disabled for the given actor, 'm ()' is not evaluated.