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