Slimmed down dependencies
This commit is contained in:
parent
dcf9208cf5
commit
fa98452452
@ -25,10 +25,9 @@ import Yesod.Handler
|
|||||||
import Control.Applicative hiding (optional)
|
import Control.Applicative hiding (optional)
|
||||||
import Data.Time (Day)
|
import Data.Time (Day)
|
||||||
import Data.Convertible.Text
|
import Data.Convertible.Text
|
||||||
import Data.Attempt
|
import Control.Monad.Attempt
|
||||||
import Data.Maybe (fromMaybe)
|
import Data.Maybe (fromMaybe)
|
||||||
import "transformers" Control.Monad.IO.Class (MonadIO)
|
import "transformers" Control.Monad.IO.Class (MonadIO)
|
||||||
import qualified Safe.Failure
|
|
||||||
|
|
||||||
noParamNameError :: String
|
noParamNameError :: String
|
||||||
noParamNameError = "No param name (miscalling of Yesod.Form library)"
|
noParamNameError = "No param name (miscalling of Yesod.Form library)"
|
||||||
@ -118,9 +117,9 @@ checkBool = applyForm $ \pv -> Right $ case pv of
|
|||||||
|
|
||||||
checkInteger :: Form ParamValue -> Form Integer
|
checkInteger :: Form ParamValue -> Form Integer
|
||||||
checkInteger = applyForm $ \pv ->
|
checkInteger = applyForm $ \pv ->
|
||||||
case Safe.Failure.read pv of
|
case reads pv of
|
||||||
Nothing -> Left "Invalid integer"
|
[] -> Left "Invalid integer"
|
||||||
Just i -> Right i
|
((i, _):_) -> Right i
|
||||||
|
|
||||||
-- | Instead of calling 'failure' with an 'InvalidArgs', return the error
|
-- | Instead of calling 'failure' with an 'InvalidArgs', return the error
|
||||||
-- messages.
|
-- messages.
|
||||||
|
|||||||
@ -39,7 +39,6 @@ module Yesod.Request
|
|||||||
) where
|
) where
|
||||||
|
|
||||||
import qualified Network.Wai as W
|
import qualified Network.Wai as W
|
||||||
import Data.Function.Predicate (equals)
|
|
||||||
import Yesod.Definitions
|
import Yesod.Definitions
|
||||||
import Web.Encodings
|
import Web.Encodings
|
||||||
import qualified Data.ByteString as B
|
import qualified Data.ByteString as B
|
||||||
@ -119,7 +118,10 @@ iothunk = fmap go . newMVar . Left where
|
|||||||
|
|
||||||
-- | All cookies with the given name.
|
-- | All cookies with the given name.
|
||||||
cookies :: Request -> ParamName -> [ParamValue]
|
cookies :: Request -> ParamName -> [ParamValue]
|
||||||
cookies rr name = map snd . filter (fst `equals` name) . reqCookies $ rr
|
cookies rr name =
|
||||||
|
map snd . filter (fst `equals` name) . reqCookies $ rr
|
||||||
|
where
|
||||||
|
equals f x y = f y == x
|
||||||
|
|
||||||
parseWaiRequest :: W.Request
|
parseWaiRequest :: W.Request
|
||||||
-> [(B.ByteString, B.ByteString)] -- ^ session
|
-> [(B.ByteString, B.ByteString)] -- ^ session
|
||||||
|
|||||||
14
yesod.cabal
14
yesod.cabal
@ -37,27 +37,19 @@ library
|
|||||||
else
|
else
|
||||||
Buildable: True
|
Buildable: True
|
||||||
build-depends: base >= 4 && < 5,
|
build-depends: base >= 4 && < 5,
|
||||||
old-locale >= 1.0.0.1 && < 1.1,
|
|
||||||
time >= 1.1.3 && < 1.2,
|
time >= 1.1.3 && < 1.2,
|
||||||
wai >= 0.0.0 && < 0.1,
|
wai >= 0.2.0 && < 0.3,
|
||||||
wai-extra >= 0.0.0 && < 0.1,
|
wai-extra >= 0.0.0 && < 0.3,
|
||||||
split >= 0.1.1 && < 0.2,
|
|
||||||
authenticate >= 0.6 && < 0.7,
|
authenticate >= 0.6 && < 0.7,
|
||||||
predicates >= 0.1 && < 0.2,
|
|
||||||
bytestring >= 0.9.1.4 && < 0.10,
|
bytestring >= 0.9.1.4 && < 0.10,
|
||||||
web-encodings >= 0.2.4 && < 0.3,
|
web-encodings >= 0.2.4 && < 0.5,
|
||||||
data-object >= 0.2.0 && < 0.3,
|
data-object >= 0.2.0 && < 0.3,
|
||||||
directory >= 1 && < 1.1,
|
directory >= 1 && < 1.1,
|
||||||
transformers >= 0.2.0 && < 0.3,
|
transformers >= 0.2.0 && < 0.3,
|
||||||
control-monad-attempt >= 0.2.0 && < 0.3,
|
control-monad-attempt >= 0.2.0 && < 0.3,
|
||||||
syb,
|
|
||||||
text >= 0.5 && < 0.8,
|
text >= 0.5 && < 0.8,
|
||||||
convertible-text >= 0.2.0 && < 0.3,
|
convertible-text >= 0.2.0 && < 0.3,
|
||||||
data-object-json >= 0.0.0 && < 0.1,
|
|
||||||
attempt >= 0.2.1 && < 0.3,
|
|
||||||
template-haskell,
|
template-haskell,
|
||||||
failure >= 0.0.0 && < 0.1,
|
|
||||||
safe-failure >= 0.4.0 && < 0.5,
|
|
||||||
web-routes >= 0.22 && < 0.23,
|
web-routes >= 0.22 && < 0.23,
|
||||||
web-routes-quasi >= 0.0 && < 0.1,
|
web-routes-quasi >= 0.0 && < 0.1,
|
||||||
hamlet >= 0.0 && < 0.1
|
hamlet >= 0.0 && < 0.1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user