brassica-0.2.0: Featureful sound change applier
Safe HaskellSafe-Inferred
LanguageHaskell2010

Brassica.SoundChange.Category

Synopsis

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 #

Constructors

NotFound String

A category with that name was not found

InvalidBaseValue

A Lexeme was used as a base value in a feature

MismatchedLengths

A FeatureSpec contained a mismatched number of values

Instances

Instances details
Generic ExpandError Source # 
Instance details

Defined in Brassica.SoundChange.Category

Associated Types

type Rep ExpandError :: Type -> Type #

Show ExpandError Source # 
Instance details

Defined in Brassica.SoundChange.Category

NFData ExpandError Source # 
Instance details

Defined in Brassica.SoundChange.Category

Methods

rnf :: ExpandError -> () #

type Rep ExpandError Source # 
Instance details

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.