Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data PrefixTree a
- = Leaf !Key !a
- | Branch {
- bCommonPref :: !Prefix
- bVal :: !(Maybe a)
- bPrefixMap :: !(PrefixMap a)
- 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
Eq a => Eq (PrefixTree a) Source # | |
Defined in Toml.PrefixTree (==) :: PrefixTree a -> PrefixTree a -> Bool # (/=) :: PrefixTree a -> PrefixTree a -> Bool # | |
Show a => Show (PrefixTree a) Source # | |
Defined in Toml.PrefixTree showsPrec :: Int -> PrefixTree a -> ShowS # show :: PrefixTree a -> String # showList :: [PrefixTree a] -> ShowS # | |
Semigroup (PrefixTree a) Source # | |
Defined in Toml.PrefixTree (<>) :: PrefixTree a -> PrefixTree a -> PrefixTree a # sconcat :: NonEmpty (PrefixTree a) -> PrefixTree a # stimes :: Integral b => b -> PrefixTree a -> PrefixTree a # |
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.
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 # | |
Hashable Key Source # | |
Defined in Toml.PrefixTree | |
type Rep Key Source # | |
Defined in Toml.PrefixTree |