digestive-functors-snap 0.0.2.1 → 0.1.0.0
raw patch · 2 files changed
+8/−8 lines, 2 filesdep ~digestive-functorsPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: digestive-functors
API changes (from Hackage documentation)
- Text.Digestive.Forms.Snap: type SnapForm e v a = MonadSnap m => Form m SnapInput e v a
+ Text.Digestive.Forms.Snap: type SnapForm m = Form m SnapInput
- Text.Digestive.Forms.Snap: eitherSnapForm :: MonadSnap m => SnapForm e v a -> String -> m (Either v a)
+ Text.Digestive.Forms.Snap: eitherSnapForm :: MonadSnap m => SnapForm m e v a -> String -> m (Either v a)
Files
digestive-functors-snap.cabal view
@@ -1,5 +1,5 @@ Name: digestive-functors-snap-Version: 0.0.2.1+Version: 0.1.0.0 Synopsis: Snap backend for the digestive-functors library Description: This is a snap backend for the digestive-functors library. @@ -17,7 +17,7 @@ Hs-source-dirs: src Exposed-modules: Text.Digestive.Forms.Snap Build-depends: base >= 4 && < 5,- digestive-functors == 0.0.2.*,+ digestive-functors == 0.1.0.*, snap-core >= 0.3, bytestring >= 0.9, utf8-string >= 0.3
src/Text/Digestive/Forms/Snap.hs view
@@ -1,6 +1,6 @@ -- | Module providing a snap backend for the digestive-functors library ---{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, Rank2Types #-}+{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} module Text.Digestive.Forms.Snap ( SnapInput , SnapForm@@ -21,12 +21,12 @@ newtype SnapInput = SnapInput {unSnapInput :: SB.ByteString} instance FormInput SnapInput () where- getInputString = Just . SB.toString . unSnapInput+ getInputStrings = return . SB.toString . unSnapInput getInputFile = const Nothing -- | Simplification of the `Form` type, instantiated to Snap ---type SnapForm e v a = (MonadSnap m) => Form m SnapInput e v a+type SnapForm m = Form m SnapInput -- | Environment that will fetch input from the parameters parsed by Snap --@@ -45,9 +45,9 @@ -- you will get the actual result -- eitherSnapForm :: (MonadSnap m)- => SnapForm e v a -- ^ Form- -> String -- ^ Form name- -> m (Either v a) -- ^ Result+ => SnapForm m e v a -- ^ Form+ -> String -- ^ Form name+ -> m (Either v a) -- ^ Result eitherSnapForm form name = do method' <- rqMethod <$> getRequest case method' of GET -> liftM Left $ viewForm form name