Spock-digestive 0.1.0.1 → 0.2.0.0
raw patch · 3 files changed
+44/−7 lines, 3 filesdep ~SpockPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: Spock
API changes (from Hackage documentation)
- Web.Spock.Digestive: runForm :: (Functor m, MonadIO m) => Text -> Form v (ActionT m) a -> ActionT m (View v, Maybe a)
+ Web.Spock.Digestive: runForm :: (Functor m, MonadIO m) => Text -> Form v (ActionCtxT ctx m) a -> ActionCtxT ctx m (View v, Maybe a)
Files
- README.md +34/−0
- Spock-digestive.cabal +6/−3
- src/Web/Spock/Digestive.hs +4/−4
+ README.md view
@@ -0,0 +1,34 @@+Spock-digestive+=====++[](https://travis-ci.org/agrafix/Spock-digestive)+[](http://hackage.haskell.org/package/Spock-digestive)++## Intro++Hackage: [Spock-digestive](http://hackage.haskell.org/package/Spock-digestive)+Stackage: [Spock-digestive](https://www.stackage.org/package/Spock-digestive)++Digestive functors support for Spock+++## Install++* Using cabal: `cabal install Spock-digestive`+* Using Stack: `stack install Spock-digestive`+* From Source (cabal): `git clone https://github.com/agrafix/Spock-digestive.git && cd Spock-digestive && cabal install`+* From Source (stack): `git clone https://github.com/agrafix/Spock-digestive.git && cd Spock-digestive && stack build`+++## Misc++### Supported GHC Versions++* 7.6.3+* 7.8.4+* 7.10.2++### License++Released under the MIT license.+(c) 2014 - 2015 Alexander Thiemann <mail@athiemann.net>
Spock-digestive.cabal view
@@ -1,5 +1,5 @@ name: Spock-digestive-version: 0.1.0.1+version: 0.2.0.0 synopsis: Digestive functors support for Spock description: Run forms defined using digestive functors with Spock homepage: https://github.com/agrafix/Spock-digestive@@ -12,11 +12,14 @@ category: Web build-type: Simple cabal-version: >=1.10+tested-with: GHC==7.6.3, GHC==7.8.4, GHC==7.10.2+extra-source-files:+ README.md library exposed-modules: Web.Spock.Digestive build-depends:- Spock >=0.7.6,+ Spock >=0.9, base >=4.6 && <5, digestive-functors >=0.7, http-types >=0.8,@@ -29,4 +32,4 @@ source-repository head type: git- location: git://github.com/agrafix/Spock-digestive.git+ location: https://github.com/agrafix/Spock-digestive
src/Web/Spock/Digestive.hs view
@@ -18,8 +18,8 @@ -- | Run a digestive functors form runForm :: (Functor m, MonadIO m) => T.Text -- ^ form name- -> Form v (ActionT m) a- -> ActionT m (View v, Maybe a)+ -> Form v (ActionCtxT ctx m) a+ -> ActionCtxT ctx m (View v, Maybe a) runForm formName form = do httpMethod <- requestMethod <$> request if httpMethod == methodGet@@ -28,9 +28,9 @@ else postForm formName form (const $ return localEnv) where localEnv path =- do let name = fromPath $ path+ do let name = fromPath path applyParam f = map (f . snd) . filter ((== name) . fst)- vars <- (applyParam (TextInput)) <$> params+ vars <- applyParam TextInput <$> params sentFiles <- (applyParam (FileInput . uf_tempLocation) . HM.toList) <$> files return (vars ++ sentFiles)