diff --git a/yesod-form/Yesod/Form/Types.hs b/yesod-form/Yesod/Form/Types.hs index c84743fd..cf3a6e7c 100644 --- a/yesod-form/Yesod/Form/Types.hs +++ b/yesod-form/Yesod/Form/Types.hs @@ -11,6 +11,7 @@ module Yesod.Form.Types , Ints (..) -- * Form , Form + , MForm , AForm (..) -- * Build forms , Field (..) @@ -75,6 +76,8 @@ type FileEnv = Map.Map Text FileInfo type Lang = Text type Form sub master a = RWST (Maybe (Env, FileEnv), master, [Lang]) Enctype Ints (GGHandler sub master IO) a +{-# DEPRECATE Form "Use MForm instead" #-} +type MForm sub master a = RWST (Maybe (Env, FileEnv), master, [Lang]) Enctype Ints (GGHandler sub master IO) a newtype AForm sub master a = AForm { unAForm :: (master, [Text]) -> Maybe (Env, FileEnv) -> Ints -> GGHandler sub master IO (FormResult a, [FieldView sub master] -> [FieldView sub master], Ints, Enctype) diff --git a/yesod-form/yesod-form.cabal b/yesod-form/yesod-form.cabal index f6341445..e427d386 100644 --- a/yesod-form/yesod-form.cabal +++ b/yesod-form/yesod-form.cabal @@ -1,5 +1,5 @@ name: yesod-form -version: 0.3.3 +version: 0.3.4 license: BSD3 license-file: LICENSE author: Michael Snoyman diff --git a/yesod/scaffold/Foundation.hs.cg b/yesod/scaffold/Foundation.hs.cg index cbbbb074..a6ff5173 100644 --- a/yesod/scaffold/Foundation.hs.cg +++ b/yesod/scaffold/Foundation.hs.cg @@ -5,6 +5,7 @@ module Foundation , resources~sitearg~ , Handler , Widget + , Form , maybeAuth , requireAuth , module Yesod @@ -15,7 +16,7 @@ module Foundation ) where import Prelude -import Yesod +import Yesod hiding (Form) import Yesod.Static (Static, base64md5, StaticRoute(..)) import Settings.StaticFiles import Yesod.Auth @@ -73,6 +74,8 @@ mkMessage "~sitearg~" "messages" "en" -- split these actions into two functions and place them in separate files. mkYesodData "~sitearg~" $(parseRoutesFile "config/routes") +type Form x = Html -> MForm ~sitearg~ ~sitearg~ (FormResult x, Widget) + -- Please see the documentation for the Yesod typeclass. There are a number -- of settings which can be configured by overriding methods here. instance Yesod ~sitearg~ where diff --git a/yesod/scaffold/project.cabal.cg b/yesod/scaffold/project.cabal.cg index 2af3df49..63e25d8a 100644 --- a/yesod/scaffold/project.cabal.cg +++ b/yesod/scaffold/project.cabal.cg @@ -76,7 +76,7 @@ executable ~project~ , yesod-auth >= 0.7.3 && < 0.8 , yesod-static >= 0.3.1 && < 0.4 , yesod-default >= 0.4 && < 0.5 - , yesod-form >= 0.3.3 && < 0.4 + , yesod-form >= 0.3.4 && < 0.4 , mime-mail >= 0.3.0.3 && < 0.4 , clientsession >= 0.7.3 && < 0.8 , bytestring >= 0.9 && < 0.10