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 HashMap
s and Map
s.
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 :: OptRoute -> Section m -> Maybe (Option m)
- lookupSub :: OptRoute -> Section m -> Maybe (Section m)
- insertOpt :: OptRoute -> Option m -> Section m -> Section m
- insertSub :: OptRoute -> Section m -> Section m -> Section m
- deleteOpt :: OptRoute -> Section m -> Section m
- deleteSub :: OptRoute -> Section m -> Section m
- delete :: OptRoute -> Section m -> Section m
Construction
Observation
Modification
Arguments
:: OptRoute | Route 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 route under this section. If the section previously contained an option for this route, the old value is replaced.
Arguments
:: OptRoute | Route 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 route under this section. If the section previously contained a subsection for this route, the old value is replaced.
deleteOpt :: OptRoute -> Section m -> Section m Source #
Remove the option at the specified route, if present. If there is a section under this route, it won't be removed.