aboutsummaryrefslogtreecommitdiff
path: root/Types/View.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-02-17 00:38:33 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-02-17 00:38:33 -0400
commitc7b8596791a1cb38d54de5e9e6d4222cf7667700 (patch)
tree687129e762b277dd241e3535b9a35efa7bed3cf8 /Types/View.hs
parentf3865432b036c4e98a4012e9af4d0b1df787383c (diff)
better data types
Diffstat (limited to 'Types/View.hs')
-rw-r--r--Types/View.hs11
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