summaryrefslogtreecommitdiff
path: root/Handler/Common
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2017-03-14 01:06:28 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2017-03-14 01:06:28 +0100
commitd84b462a711ce95593ff05a7581e722562c3835a (patch)
tree41e5af455fea925b2680b29718b24ba2876e803a /Handler/Common
downloadbar-d84b462a711ce95593ff05a7581e722562c3835a.tar
bar-d84b462a711ce95593ff05a7581e722562c3835a.tar.gz
bar-d84b462a711ce95593ff05a7581e722562c3835a.tar.bz2
bar-d84b462a711ce95593ff05a7581e722562c3835a.tar.xz
bar-d84b462a711ce95593ff05a7581e722562c3835a.zip
Implement old bar.hs
Diffstat (limited to 'Handler/Common')
-rw-r--r--Handler/Common/Types.hs23
1 files changed, 23 insertions, 0 deletions
diff --git a/Handler/Common/Types.hs b/Handler/Common/Types.hs
new file mode 100644
index 0000000..ca7cb8d
--- /dev/null
+++ b/Handler/Common/Types.hs
@@ -0,0 +1,23 @@
1{-# LANGUAGE FunctionalDependencies #-}
2
3module Handler.Common.Types where
4
5import Import
6
7import Control.Lens
8
9data InventoryState = InventoryState
10 { stock :: [Entity Item]
11 , formState :: Maybe FormState
12 }
13
14data FormState = InsertForm
15 { fsInsertForm :: Widget
16 , fsInsertEncoding :: Enctype
17 }
18 | UpdateForm
19 { fsUpdateItem :: ItemId
20 , fsUpdateForm :: Widget
21 , fsUpdateEncoding :: Enctype
22 }
23makeLensesWith abbreviatedFields ''FormState