Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added Data and Typeable instances for File and ContentType.

  • Loading branch information...
commit 6ea615e1f5a3ff53edb3f6076b236aaa880665b5 1 parent fe49c35
Jeremy Shaw stepcut authored
Showing with 11 additions and 4 deletions.
  1. +4 −2 Text/Formlets.hs
  2. +7 −2 formlets.cabal
6 Text/Formlets.hs
View
@@ -1,3 +1,4 @@
+{-# LANGUAGE DeriveDataTypeable #-}
module Text.Formlets ( input', inputM', optionalInput, inputFile, fmapFst, nothingIfNull
, check, ensure, ensures
, ensureM, checkM, pureM
@@ -9,6 +10,7 @@ module Text.Formlets ( input', inputM', optionalInput, inputFile, fmapFst, nothi
)
where
+import Data.Generics
import Data.Monoid
import Control.Applicative
import Control.Applicative.Error
@@ -28,12 +30,12 @@ type S a = State FormState a
type Validator a = S (FR.FormResult a)
data FormContentType = UrlEncoded | MultiPart deriving (Eq, Show, Read)
newtype Form xml m a = Form { deform :: Env -> S (m (Validator a), xml, FormContentType) }
-data File = File {content :: BS.ByteString, fileName :: String, contentType :: ContentType} deriving (Eq, Show, Read)
+data File = File {content :: BS.ByteString, fileName :: String, contentType :: ContentType} deriving (Eq, Show, Read, Data, Typeable)
data ContentType = ContentType { ctType :: String
, ctSubtype :: String
, ctParameters :: [(String, String)]
}
- deriving (Eq, Show, Read)
+ deriving (Eq, Show, Read, Data, Typeable)
-- | Apply a predicate to a value and return FR.Success or FR.Failure as appropriate
ensure :: Show a
9 formlets.cabal
View
@@ -19,13 +19,18 @@ Build-Type: Simple
Cabal-Version: >= 1.6
Extra-Source-Files: README
+Flag base4
+ Description: Choose the even newer, even smaller, split-up base package.
+
Library
- Build-Depends: base >= 2 && < 5,
+ Build-Depends: base >= 2 && < 4,
haskell98,
- mtl,
+ mtl,
xhtml,
applicative-extras >= 0.1.3,
bytestring
+ if flag(base4)
+ Build-Depends: base >= 4 && < 5, syb
Exposed-Modules: Text.Formlets
, Text.Formlets.MassInput
, Text.XHtml.Strict.Formlets
Please sign in to comment.
Something went wrong with that request. Please try again.