| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Data.Settings.Section
Description
This module provides functions work working with the Section type, i.e.
option trees. The style is similar to the APIs for HashMaps and Maps.
You can use these functions to construct a custom settings tree UI. Before
you do that, try the Data.Settings.Interface module, which may already
offer what you need.
- empty :: Section m
- singleton :: SecName -> Option m -> Section m
- hasOpts :: Section m -> Bool
- hasSubs :: Section m -> Bool
- null :: Section m -> Bool
- member :: OptRoute -> Section m -> (Bool, Bool)
- memberOpt :: OptRoute -> Section m -> Bool
- memberSub :: OptRoute -> Section m -> Bool
- lookup :: OptRoute -> Section m -> Maybe (Either (Section m) (Option m))
- lookupOpt :: [String] -> Section m -> Maybe (Option m)
- lookupSub :: [String] -> Section m -> Maybe (Section m)
- insert :: [String] -> Option m -> Section m -> Section m
- insertOpt :: [String] -> Option m -> Section m -> Section m
- insertSub :: [String] -> Section m -> Section m -> Section m
- deleteOpt :: [String] -> Section m -> Section m
- deleteSub :: [String] -> Section m -> Section m
- delete :: [String] -> Section m -> Section m
Construction
Observation
Modification
Arguments
| :: [String] | Path at which to place the option |
| -> Option m | Option to insert |
| -> Section m | Root section under which to insert |
| -> Section m |
Add the specified option at the specified path under this section. If the section previously contained an option for this path, the old value is replaced.
Arguments
| :: [String] | Path at which to place the subsection |
| -> Section m | Subsection to insert |
| -> Section m | Root section under which to insert |
| -> Section m |
Add the specified subsection at the specified path under this section. If the section previously contained a subsection for this path, the old value is replaced.
deleteOpt :: [String] -> Section m -> Section m Source
Remove the option at the specified path, if present. If there is a section under this path, it won't be removed.