better data types

This commit is contained in:
Joey Hess 2014-02-17 00:38:33 -04:00
parent e806152f77
commit 103dab702b
2 changed files with 33 additions and 24 deletions

View file

@ -21,7 +21,16 @@ import Text.Regex.TDFA
#endif
{- A view is a list of fields with filters on their allowed values. -}
type View = [(MetaField, ViewFilter)]
type View = [ViewComponent]
data ViewComponent = ViewComponent
{ viewField :: MetaField
, viewFilter :: ViewFilter
}
deriving (Show, Eq)
instance Arbitrary ViewComponent where
arbitrary = ViewComponent <$> arbitrary <*> arbitrary
{- Only files with metadata matching the view are displayed. -}
type FileView = FilePath