reform-hsp 0.2.6.1 → 0.2.7
raw patch · 4 files changed
+31/−9 lines, 4 files
Files
- Text/Reform/HSP/Common.hs +9/−1
- Text/Reform/HSP/String.hs +8/−1
- Text/Reform/HSP/Text.hs +8/−1
- reform-hsp.cabal +6/−6
Text/Reform/HSP/Common.hs view
@@ -13,7 +13,7 @@ import HSP.XMLGenerator import HSP.XML -instance (EmbedAsAttr m (Attr Text Text)) => (EmbedAsAttr m (Attr Text FormId)) where+instance (XMLGen m, EmbedAsAttr m (Attr Text Text)) => (EmbedAsAttr m (Attr Text FormId)) where asAttr (n := v) = asAttr (n := (pack $ show v)) inputText :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text text)) =>@@ -23,6 +23,14 @@ inputText getInput initialValue = G.input getInput inputField initialValue where inputField i a = [hsx| [<input type="text" id=i name=i value=a />] |]++inputEmail :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text text)) =>+ (input -> Either error text)+ -> text+ -> Form m input error [XMLGenT x (XMLType x)] () text+inputEmail getInput initialValue = G.input getInput inputField initialValue+ where+ inputField i a = [hsx| [<input type="email" id=i name=i value=a />] |] inputPassword :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text text)) => (input -> Either error text)
Text/Reform/HSP/String.hs view
@@ -7,7 +7,8 @@ -} module Text.Reform.HSP.String ( -- * \<input\> element- inputText+ inputEmail+ , inputText , inputPassword , inputSubmit , inputReset@@ -46,6 +47,12 @@ import HSP.XMLGenerator import Text.Reform import qualified Text.Reform.HSP.Common as C++-- | Create an @\<input type=\"email\"\>@ element+inputEmail :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text String)) =>+ String -- ^ initial value+ -> Form m input error [XMLGenT x (XMLType x)] () String+inputEmail initialValue = C.inputEmail getInputString initialValue -- | Create an @\<input type=\"text\"\>@ element inputText :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text String)) =>
Text/Reform/HSP/Text.hs view
@@ -6,7 +6,8 @@ -} module Text.Reform.HSP.Text ( -- * \<input\> element- inputText+ inputEmail+ , inputText , inputPassword , inputSubmit , inputReset@@ -48,6 +49,12 @@ import HSP.XMLGenerator import Text.Reform import qualified Text.Reform.HSP.Common as C++-- | Create an @\<input type=\"email\"\>@ element+inputEmail :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text T.Text)) =>+ T.Text -- ^ initial value+ -> Form m input error [XMLGenT x (XMLType x)] () T.Text+inputEmail initialValue = C.inputEmail getInputText initialValue -- | Create an @\<input type=\"text\"\>@ element inputText :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text T.Text)) =>
reform-hsp.cabal view
@@ -1,5 +1,5 @@ Name: reform-hsp-Version: 0.2.6.1+Version: 0.2.7 Synopsis: Add support for using HSP with Reform Description: Reform is a library for building and validating forms using applicative functors. This package add support for using reform with HSP. Homepage: http://www.happstack.com/@@ -11,7 +11,7 @@ Category: Web Build-type: Simple Cabal-version: >=1.6-tested-with: GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3+tested-with: GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.1 source-repository head type: git@@ -21,8 +21,8 @@ Exposed-modules: Text.Reform.HSP.Common Text.Reform.HSP.String Text.Reform.HSP.Text- Build-depends: base > 4 && <5,- hsp >= 0.9 && < 0.11,- hsx2hs >= 0.13 && < 0.14,+ Build-depends: base > 4 && <5,+ hsp >= 0.9 && < 0.11,+ hsx2hs >= 0.13 && < 0.14, reform >= 0.2.1 && < 0.3,- text >= 0.11 && < 1.3+ text >= 0.11 && < 1.3