passman-core-0.3.1: Deterministic password generator

CopyrightMatthew Harm Bekkema 2016
LicenseGPL-2
Maintainermbekkema97@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

Passman.Core.Config.Optional

Contents

Description

 

Synopsis

OptionalConfig type

type OptionalConfig = Map String String Source

The optional configuration of the password manager

Query

lookup :: Read a => String -> OptionalConfig -> Maybe a Source

Lookup the value of a key in the config. Returns Nothing if key not found, or if value can not be parsed as the desired type.

Construction

empty :: OptionalConfig Source

Contains no configuration values

Insertion

insert :: Show a => String -> a -> OptionalConfig -> OptionalConfig Source

Insert a new key and value in the config. If the key is already present, the associated value is replaced with the supplied value.

Delete/Update

delete :: String -> OptionalConfig -> OptionalConfig Source

Delete a key and its value from the config.

adjust :: (Show a, Read a) => (a -> a) -> String -> OptionalConfig -> OptionalConfig Source

Update a value at a specific key with the result of the provided function. The value is left unchanged if it could not be parsed as the desired type.

update :: (Show a, Read a) => (a -> Maybe a) -> String -> OptionalConfig -> OptionalConfig Source

The expression (update f k config) updates the value x at k (if it is in the config). If (f x) is Nothing, the element is deleted. If it is (Just y), the key k is bound to the new value y. The value is left unchanged if it could not be parsed as the desired type.

alter :: (Show a, Read a) => (Maybe a -> Maybe a) -> String -> OptionalConfig -> OptionalConfig Source

The expression (alter f k config) alters the value x at k, or absence thereof. The value is left unchanged if it could not be parsed as the desired type.