From d84b462a711ce95593ff05a7581e722562c3835a Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 14 Mar 2017 01:06:28 +0100 Subject: Implement old bar.hs --- Handler/Common/Types.hs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Handler/Common/Types.hs (limited to 'Handler/Common') 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 @@ +{-# LANGUAGE FunctionalDependencies #-} + +module Handler.Common.Types where + +import Import + +import Control.Lens + +data InventoryState = InventoryState + { stock :: [Entity Item] + , formState :: Maybe FormState + } + +data FormState = InsertForm + { fsInsertForm :: Widget + , fsInsertEncoding :: Enctype + } + | UpdateForm + { fsUpdateItem :: ItemId + , fsUpdateForm :: Widget + , fsUpdateEncoding :: Enctype + } +makeLensesWith abbreviatedFields ''FormState -- cgit v1.2.3