diff options
author | Joey Hess <joey@kitenet.net> | 2014-02-17 00:38:33 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-02-17 00:38:33 -0400 |
commit | c7b8596791a1cb38d54de5e9e6d4222cf7667700 (patch) | |
tree | 687129e762b277dd241e3535b9a35efa7bed3cf8 /Types | |
parent | f3865432b036c4e98a4012e9af4d0b1df787383c (diff) |
better data types
Diffstat (limited to 'Types')
-rw-r--r-- | Types/View.hs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Types/View.hs b/Types/View.hs index ff2731593..2c30541fa 100644 --- a/Types/View.hs +++ b/Types/View.hs @@ -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 |