Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data PrefixTree a
- = Leaf !Key !a
- | Branch {
- bCommonPref :: !Prefix
- bVal :: !(Maybe a)
- bPrefixMap :: !(PrefixMap a)
- (<|) :: Piece -> Key -> Key
- singleT :: Key -> a -> PrefixTree a
- insertT :: Key -> a -> PrefixTree a -> PrefixTree a
- lookupT :: Key -> PrefixTree a -> Maybe a
- toListT :: PrefixTree a -> [(Key, a)]
- type PrefixMap a = HashMap Piece (PrefixTree a)
- single :: Key -> a -> PrefixMap a
- insert :: Key -> a -> PrefixMap a -> PrefixMap a
- lookup :: Key -> PrefixMap a -> Maybe a
- fromList :: [(Key, a)] -> PrefixMap a
- toList :: PrefixMap a -> [(Key, a)]
- newtype Piece = Piece {}
- newtype Key = Key {}
- pattern (:||) :: Piece -> [Piece] -> Key
- type Prefix = Key
- data KeysDiff
Documentation
data PrefixTree a Source #
Data structure to represent table tree for toml
.
Leaf !Key !a | |
Branch | |
|
Instances
singleT :: Key -> a -> PrefixTree a Source #
Creates a PrefixTree
of one key-value element.
insertT :: Key -> a -> PrefixTree a -> PrefixTree a Source #
Inserts key-value element into the given PrefixTree
.
lookupT :: Key -> PrefixTree a -> Maybe a Source #
Looks up the value at a key in the PrefixTree
.
toListT :: PrefixTree a -> [(Key, a)] Source #
Converts PrefixTree
to the list of pairs.
type PrefixMap a = HashMap Piece (PrefixTree a) Source #
Map of layer names and corresponding PrefixTree
s.
insert :: Key -> a -> PrefixMap a -> PrefixMap a Source #
Inserts key-value element into the given PrefixMap
.
Types
Represents the key piece of some layer.
Instances
Eq Piece Source # | |
Ord Piece Source # | |
Show Piece Source # | |
IsString Piece Source # | |
Defined in Toml.PrefixTree fromString :: String -> Piece # | |
Generic Piece Source # | |
NFData Piece Source # | |
Defined in Toml.PrefixTree | |
Hashable Piece Source # | |
Defined in Toml.PrefixTree | |
type Rep Piece Source # | |
Defined in Toml.PrefixTree |
Key of value in key = val
pair. Represents as non-empty list of key
components -- Piece
s. Key like
site."google.com"
is represented like
Key (Piece "site" :| [Piece "\"google.com\""])
Instances
Eq Key Source # | |
Ord Key Source # | |
Show Key Source # | |
IsString Key Source # | Split a dot-separated string into |
Defined in Toml.PrefixTree fromString :: String -> Key # | |
Generic Key Source # | |
Semigroup Key Source # | |
NFData Key Source # | |
Defined in Toml.PrefixTree | |
Hashable Key Source # | |
Defined in Toml.PrefixTree | |
type Rep Key Source # | |
Defined in Toml.PrefixTree |