Permalink
Browse files

Now compatible with Scotty 0.7 and Digestive Functors 0.7

  • Loading branch information...
chris
chris committed Apr 8, 2014
1 parent 0f1acef commit 48593773c0a571b06bb6831c1a1941ef6e858914
Showing with 9 additions and 9 deletions.
  1. +4 −4 digestive-functors-scotty.cabal
  2. +5 −5 src/Text/Digestive/Scotty.hs
View
8 digestive-functors-scotty.cabal 100644 → 100755
@@ -18,13 +18,13 @@ library
exposed-modules: Text.Digestive.Scotty
build-depends: base ==4.*
- , digestive-functors ==0.6.*
- , scotty ==0.5.*
+ , digestive-functors ==0.7.*
+ , scotty ==0.7.*
, bytestring >=0.9 && <0.11
, http-types ==0.8.*
, text >=0.11 && <1.0
- , wai >=1.4 && <2.0
- , wai-extra >=1.3 && <2.0
+ , wai >=2.0.0 && <2.2
+ , wai-extra >=2.0.1 && <2.2
source-repository head
Type: git
View
10 src/Text/Digestive/Scotty.hs 100644 → 100755
@@ -16,7 +16,7 @@ import Text.Digestive.Form
import Text.Digestive.Types
import Text.Digestive.View
-scottyEnv :: Monad m => Env (Scotty.ActionT m)
+scottyEnv :: (Monad m, Scotty.ScottyError e) => Env (Scotty.ActionT e m)
scottyEnv path = do
inputs <- parse (TextInput . TL.toStrict) Scotty.params
files <- parse (FileInput . B.unpack . fileName) Scotty.files
@@ -25,12 +25,12 @@ scottyEnv path = do
name = TL.fromStrict . fromPath $ path
-- | Runs a form with the HTTP input provided by Scotty.
-runForm :: Monad m
+runForm :: (Monad m, Scotty.ScottyError e)
=> T.Text -- ^ Name of the form
- -> Form v (Scotty.ActionT m) a -- ^ Form to run
- -> (Scotty.ActionT m) (View v, Maybe a) -- ^ Result
+ -> Form v (Scotty.ActionT e m) a -- ^ Form to run
+ -> (Scotty.ActionT e m) (View v, Maybe a) -- ^ Result
runForm name form = Scotty.request >>= \rq ->
if requestMethod rq == methodGet
then getForm name form >>= \v -> return (v, Nothing)
- else postForm name form scottyEnv
+ else postForm name form (\ _ -> return scottyEnv)

0 comments on commit 4859377

Please sign in to comment.