Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type Categories = Map String (Expanded 'AnyPart)
- lookup :: String -> Categories -> Maybe (Expanded a)
- values :: Categories -> [Either Grapheme [Lexeme Expanded 'AnyPart]]
- data ExpandError
- expand :: Categories -> CategorySpec a -> Either ExpandError (Expanded a)
- expandRule :: Categories -> Rule CategorySpec -> Either ExpandError (Rule Expanded)
- extend :: Categories -> Directive -> Either ExpandError Categories
- expandSoundChanges :: SoundChanges CategorySpec Directive -> Either ExpandError (SoundChanges Expanded [Grapheme])
Documentation
type Categories = Map String (Expanded 'AnyPart) Source #
A map from names to the (expanded) categories they reference. Used to resolve cross-references between categories.
lookup :: String -> Categories -> Maybe (Expanded a) Source #
Lookup a category name in Categories
.
values :: Categories -> [Either Grapheme [Lexeme Expanded 'AnyPart]] Source #
Returns a list of every value mentioned in a set of
Categories
data ExpandError Source #
NotFound String | A category with that name was not found |
InvalidBaseValue | A |
MismatchedLengths | A |
Instances
Generic ExpandError Source # | |
Defined in Brassica.SoundChange.Category type Rep ExpandError :: Type -> Type # from :: ExpandError -> Rep ExpandError x # to :: Rep ExpandError x -> ExpandError # | |
Show ExpandError Source # | |
Defined in Brassica.SoundChange.Category showsPrec :: Int -> ExpandError -> ShowS # show :: ExpandError -> String # showList :: [ExpandError] -> ShowS # | |
NFData ExpandError Source # | |
Defined in Brassica.SoundChange.Category rnf :: ExpandError -> () # | |
type Rep ExpandError Source # | |
Defined in Brassica.SoundChange.Category type Rep ExpandError = D1 ('MetaData "ExpandError" "Brassica.SoundChange.Category" "brassica-0.2.0-6DYGqWgsRcQ5pGt1m6P3TU" 'False) (C1 ('MetaCons "NotFound" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: (C1 ('MetaCons "InvalidBaseValue" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MismatchedLengths" 'PrefixI 'False) (U1 :: Type -> Type))) |
expand :: Categories -> CategorySpec a -> Either ExpandError (Expanded a) Source #
Given a category, return the list of values which it matches.
expandRule :: Categories -> Rule CategorySpec -> Either ExpandError (Rule Expanded) Source #
extend :: Categories -> Directive -> Either ExpandError Categories Source #