packages feed

digestive-functors-scotty 0.1.0.0 → 0.1.1.0

raw patch · 2 files changed

+5/−4 lines, 2 files

Files

digestive-functors-scotty.cabal view
@@ -1,5 +1,5 @@ name:                digestive-functors-scotty-version:             0.1.0.0+version:             0.1.1.0 synopsis:            Scotty backend for the digestive-functors library description:         Scotty backend for the digestive-functors library homepage:            https://bitbucket.org/wniare/digestive-functors-scotty
src/Text/Digestive/Scotty.hs view
@@ -18,10 +18,11 @@  scottyEnv :: Monad m => Env (Scotty.ActionT m) scottyEnv path = do-    inputs <- liftM (map $ TextInput . TL.toStrict) $ Scotty.param name `Scotty.rescue` \_ -> return []-    files  <- liftM (map (FileInput . B.unpack . fileName . snd) . filter ((== name) . fst)) Scotty.files+    inputs <- parse (TextInput . TL.toStrict) Scotty.params+    files  <- parse (FileInput . B.unpack . fileName) Scotty.files     return $ inputs ++ files-  where name = TL.fromStrict . fromPath $ path+  where parse f = liftM $ map (f . snd) . filter ((== name) . fst)+        name    = TL.fromStrict . fromPath $ path  -- | Runs a form with the HTTP input provided by Scotty. runForm :: Monad m