filter branches (incomplete)

Promosing work toward metadata driven filter branches. A few methods
to construct them are stubbed out; all the data types and pure code
seems good.

This commit was sponsored by Walter Somerville.
This commit is contained in:
Joey Hess 2014-02-16 17:39:54 -04:00
parent 2825f2e41d
commit 9633c67842
5 changed files with 246 additions and 0 deletions

View file

@ -16,6 +16,8 @@ module Types.MetaData (
deserialize,
MetaSerializable,
toMetaField,
mkMetaField,
tagMetaField,
fromMetaField,
toMetaValue,
mkMetaValue,
@ -225,6 +227,9 @@ mkMetaField f = maybe (Left $ badField f) Right (toMetaField f)
badField :: String -> String
badField f = "Illegal metadata field name, \"" ++ f ++ "\""
tagMetaField :: MetaField
tagMetaField = MetaField "tag"
{- Avoid putting too many fields in the map; extremely large maps make
- the seriaization test slow due to the sheer amount of data.
- It's unlikely that more than 100 fields of metadata will be used. -}