Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Trie a = Trie {
- unLanguage :: Map ISO639_1 (Trie2 a)
- fromList :: [(BCP47, a)] -> Trie a
- singleton :: BCP47 -> a -> Trie a
- union :: Trie a -> Trie a -> Trie a
- unionWith :: (a -> a -> a) -> Trie a -> Trie a -> Trie a
- unionUsing :: (Maybe a -> Maybe a -> Maybe a) -> Trie a -> Trie a -> Trie a
- data Trie2 a = Trie2 (Maybe a) (Map Subtags (Trie2 a))
- data Subtags
- singleton2 :: BCP47 -> a -> Trie2 a
- lookup2 :: BCP47 -> Trie2 a -> Maybe a
- match2 :: BCP47 -> Trie2 a -> Maybe a
- union2 :: Trie2 a -> Trie2 a -> Trie2 a
- union2Using :: (Maybe a -> Maybe a -> Maybe a) -> Trie2 a -> Trie2 a -> Trie2 a
- fromSubtags :: [Subtags] -> a -> Trie2 a
Documentation
A trie mapping BCP47
tags to values
Trie | |
|
Instances
Functor Trie Source # | |
Foldable Trie Source # | |
Defined in Data.BCP47.Trie.Internal fold :: Monoid m => Trie m -> m # foldMap :: Monoid m => (a -> m) -> Trie a -> m # foldr :: (a -> b -> b) -> b -> Trie a -> b # foldr' :: (a -> b -> b) -> b -> Trie a -> b # foldl :: (b -> a -> b) -> b -> Trie a -> b # foldl' :: (b -> a -> b) -> b -> Trie a -> b # foldr1 :: (a -> a -> a) -> Trie a -> a # foldl1 :: (a -> a -> a) -> Trie a -> a # elem :: Eq a => a -> Trie a -> Bool # maximum :: Ord a => Trie a -> a # | |
Traversable Trie Source # | |
Eq a => Eq (Trie a) Source # | |
Ord a => Ord (Trie a) Source # | |
Show a => Show (Trie a) Source # | |
Semigroup a => Semigroup (Trie a) Source # | |
Semigroup a => Monoid (Trie a) Source # | |
Arbitrary a => Arbitrary (Trie a) Source # | |
union :: Trie a -> Trie a -> Trie a Source #
A left-biased union of two Trie
structures. The left value is prefered
when duplicate tags are found.
Instances
Functor Trie2 Source # | |
Foldable Trie2 Source # | |
Defined in Data.BCP47.Trie.Internal fold :: Monoid m => Trie2 m -> m # foldMap :: Monoid m => (a -> m) -> Trie2 a -> m # foldr :: (a -> b -> b) -> b -> Trie2 a -> b # foldr' :: (a -> b -> b) -> b -> Trie2 a -> b # foldl :: (b -> a -> b) -> b -> Trie2 a -> b # foldl' :: (b -> a -> b) -> b -> Trie2 a -> b # foldr1 :: (a -> a -> a) -> Trie2 a -> a # foldl1 :: (a -> a -> a) -> Trie2 a -> a # elem :: Eq a => a -> Trie2 a -> Bool # maximum :: Ord a => Trie2 a -> a # minimum :: Ord a => Trie2 a -> a # | |
Traversable Trie2 Source # | |
Eq a => Eq (Trie2 a) Source # | |
Ord a => Ord (Trie2 a) Source # | |
Show a => Show (Trie2 a) Source # | |
Semigroup a => Semigroup (Trie2 a) Source # | |
Monoid a => Monoid (Trie2 a) Source # | |
SpecifyLanguageExtension LanguageExtension | |
SpecifyScript Script | |
SpecifyRegion Country | |
SpecifyVariant Variant | |
SpecifyExtension Extension | |
SpecifyPrivateUse PrivateUse |
singleton2 :: BCP47 -> a -> Trie2 a Source #
fromSubtags :: [Subtags] -> a -> Trie2 a Source #