From c0ab2e6178d8e1158f5b634edbbc9ee98d83d1af Mon Sep 17 00:00:00 2001 From: Greg Weber Date: Sat, 24 Dec 2011 23:01:24 -0300 Subject: [PATCH] import qualified Text as TS -> as T --- yesod-core/Yesod/Internal/Core.hs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/yesod-core/Yesod/Internal/Core.hs b/yesod-core/Yesod/Internal/Core.hs index 29e1355a..51f6b87b 100644 --- a/yesod-core/Yesod/Internal/Core.hs +++ b/yesod-core/Yesod/Internal/Core.hs @@ -59,7 +59,7 @@ import Web.Cookie (parseCookies) import qualified Data.Map as Map import Data.Time import Network.HTTP.Types (encodePath) -import qualified Data.Text as TS +import qualified Data.Text as T import Data.Text (Text) import qualified Data.Text.Encoding as TE import qualified Data.Text.Encoding.Error as TEE @@ -214,15 +214,15 @@ class RenderRoute (Route a) => Yesod a where then Right s else Left corrected where - corrected = filter (not . TS.null) s + corrected = filter (not . T.null) s -- | Builds an absolute URL by concatenating the application root with the -- pieces of a path and a query string, if any. -- Note that the pieces of the path have been previously cleaned up by 'cleanPath'. joinPath :: a - -> TS.Text -- ^ application root - -> [TS.Text] -- ^ path pieces - -> [(TS.Text, TS.Text)] -- ^ query string + -> T.Text -- ^ application root + -> [T.Text] -- ^ path pieces + -> [(T.Text, T.Text)] -- ^ query string -> Builder joinPath _ ar pieces' qs' = fromText ar `mappend` encodePath pieces qs where @@ -261,7 +261,7 @@ class RenderRoute (Route a) => Yesod a where maximumContentLength :: a -> Maybe (Route a) -> Int maximumContentLength _ _ = 2 * 1024 * 1024 -- 2 megabytes - -- | Send a message to the log. By default, prints to stderr. + -- | Send a message to the log. By default, prints to stdout. messageLogger :: a -> Loc -- ^ position in source code -> LogLevel @@ -294,7 +294,7 @@ instance Lift LogLevel where lift LevelInfo = [|LevelInfo|] lift LevelWarn = [|LevelWarn|] lift LevelError = [|LevelError|] - lift (LevelOther x) = [|LevelOther $ TS.pack $(lift $ TS.unpack x)|] + lift (LevelOther x) = [|LevelOther $ T.pack $(lift $ T.unpack x)|] formatLogMessage :: Loc -> LogLevel @@ -303,13 +303,13 @@ formatLogMessage :: Loc formatLogMessage loc level msg = do now <- getCurrentTime return $ TB.toLazyText $ - TB.fromText (TS.pack $ show now) + TB.fromText (T.pack $ show now) `mappend` TB.fromText " [" - `mappend` TB.fromText (TS.pack $ drop 5 $ show level) + `mappend` TB.fromText (T.pack $ drop 5 $ show level) `mappend` TB.fromText "] " `mappend` TB.fromText msg `mappend` TB.fromText " @(" - `mappend` TB.fromText (TS.pack $ fileLocationToString loc) + `mappend` TB.fromText (T.pack $ fileLocationToString loc) `mappend` TB.fromText ") " -- taken from file-location package