Fix warnings
This commit is contained in:
parent
8d5c4a3348
commit
5321bd0dfa
@ -24,14 +24,12 @@ module Yesod.Dispatch
|
|||||||
) where
|
) where
|
||||||
|
|
||||||
import Data.Functor ((<$>))
|
import Data.Functor ((<$>))
|
||||||
import Data.Either (partitionEithers)
|
|
||||||
import Prelude hiding (exp)
|
import Prelude hiding (exp)
|
||||||
import Yesod.Internal.Core
|
import Yesod.Internal.Core
|
||||||
import Yesod.Handler hiding (lift)
|
import Yesod.Handler hiding (lift)
|
||||||
import Yesod.Widget (GWidget)
|
import Yesod.Widget (GWidget)
|
||||||
|
|
||||||
import Web.PathPieces
|
import Web.PathPieces
|
||||||
import Yesod.Routes.Parse (parseRoutes, parseRoutesNoCheck, parseRoutesFile, parseRoutesFileNoCheck)
|
|
||||||
import Language.Haskell.TH.Syntax
|
import Language.Haskell.TH.Syntax
|
||||||
|
|
||||||
import qualified Network.Wai as W
|
import qualified Network.Wai as W
|
||||||
@ -41,7 +39,6 @@ import Network.Wai.Middleware.Autohead
|
|||||||
import Data.ByteString.Lazy.Char8 ()
|
import Data.ByteString.Lazy.Char8 ()
|
||||||
|
|
||||||
import Web.ClientSession
|
import Web.ClientSession
|
||||||
import Data.Char (isUpper)
|
|
||||||
import Data.Text (Text)
|
import Data.Text (Text)
|
||||||
import Data.Text.Encoding (decodeUtf8With)
|
import Data.Text.Encoding (decodeUtf8With)
|
||||||
import Data.Text.Encoding.Error (lenientDecode)
|
import Data.Text.Encoding.Error (lenientDecode)
|
||||||
@ -126,10 +123,10 @@ mkYesodGeneral name args clazzes isSub resS = do
|
|||||||
let ytyp = if isSub
|
let ytyp = if isSub
|
||||||
then ConT ''YesodDispatch `AppT` arg `AppT` VarT master
|
then ConT ''YesodDispatch `AppT` arg `AppT` VarT master
|
||||||
else ConT ''YesodDispatch `AppT` arg `AppT` arg
|
else ConT ''YesodDispatch `AppT` arg `AppT` arg
|
||||||
let yesodDispatch =
|
let yesodDispatch' =
|
||||||
InstanceD ctx ytyp [FunD (mkName "yesodDispatch") [disp]]
|
InstanceD ctx ytyp [FunD (mkName "yesodDispatch") [disp]]
|
||||||
|
|
||||||
return (renderRouteDec : masterTypSyns, [yesodDispatch])
|
return (renderRouteDec : masterTypSyns, [yesodDispatch'])
|
||||||
where
|
where
|
||||||
name' = mkName name
|
name' = mkName name
|
||||||
masterTypSyns
|
masterTypSyns
|
||||||
|
|||||||
@ -9,15 +9,10 @@ module Yesod.Routes.Parse
|
|||||||
, parseType
|
, parseType
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Web.PathPieces
|
|
||||||
import Language.Haskell.TH.Syntax
|
import Language.Haskell.TH.Syntax
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import Data.Either
|
import Data.Char (isUpper)
|
||||||
import Data.List
|
|
||||||
import Data.Char (toLower, isUpper)
|
|
||||||
import qualified Data.Text
|
|
||||||
import Language.Haskell.TH.Quote
|
import Language.Haskell.TH.Quote
|
||||||
import Data.Data
|
|
||||||
import qualified System.IO as SIO
|
import qualified System.IO as SIO
|
||||||
import Yesod.Routes.TH
|
import Yesod.Routes.TH
|
||||||
|
|
||||||
@ -79,7 +74,7 @@ dispatchFromString rest mmulti
|
|||||||
| all (all isUpper) rest = Methods mmulti rest
|
| all (all isUpper) rest = Methods mmulti rest
|
||||||
dispatchFromString [subTyp, subFun] Nothing =
|
dispatchFromString [subTyp, subFun] Nothing =
|
||||||
Subsite subTyp subFun
|
Subsite subTyp subFun
|
||||||
dispatchFromString [subTyp, subFun] Just{} =
|
dispatchFromString [_, _] Just{} =
|
||||||
error "Subsites cannot have a multipiece"
|
error "Subsites cannot have a multipiece"
|
||||||
dispatchFromString rest _ = error $ "Invalid list of methods: " ++ show rest
|
dispatchFromString rest _ = error $ "Invalid list of methods: " ++ show rest
|
||||||
|
|
||||||
@ -92,7 +87,7 @@ piecesFromString "" = ([], Nothing)
|
|||||||
piecesFromString x =
|
piecesFromString x =
|
||||||
case (this, rest) of
|
case (this, rest) of
|
||||||
(Left typ, ([], Nothing)) -> ([], Just typ)
|
(Left typ, ([], Nothing)) -> ([], Just typ)
|
||||||
(Left typ, _) -> error "Multipiece must be last piece"
|
(Left _, _) -> error "Multipiece must be last piece"
|
||||||
(Right piece, (pieces, mtyp)) -> (piece:pieces, mtyp)
|
(Right piece, (pieces, mtyp)) -> (piece:pieces, mtyp)
|
||||||
where
|
where
|
||||||
(y, z) = break (== '/') x
|
(y, z) = break (== '/') x
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user