Move some Yesod exports to Yesod.Core

This commit is contained in:
Michael Snoyman 2013-06-06 10:05:22 +03:00
parent 772563c46b
commit 8e5c419dd5
3 changed files with 36 additions and 37 deletions

View File

@ -78,6 +78,26 @@ module Yesod.Core
, MonadBaseControl
, MonadResource (..)
, MonadLogger
-- * Commonly referenced functions/datatypes
, Application
-- * Utilities
, showIntegral
, readIntegral
-- * Shakespeare
-- ** Hamlet
, hamlet
, shamlet
, xhamlet
, HtmlUrl
-- ** Julius
, julius
, JavascriptUrl
, renderJavascriptUrl
-- ** Cassius/Lucius
, cassius
, lucius
, CssUrl
, renderCssUrl
) where
import Yesod.Core.Content
@ -108,6 +128,11 @@ import Control.Monad.Trans.Control (MonadBaseControl (..))
import Control.Monad.Trans.Resource (MonadResource (..))
import Yesod.Core.Internal.LiteApp
import Text.Hamlet
import Text.Cassius
import Text.Lucius
import Text.Julius
import Network.Wai (Application)
-- | Return an 'Unauthorized' value, with the given i18n message.
unauthorizedI :: (MonadHandler m, RenderMessage (HandlerSite m) msg) => msg -> m AuthResult
@ -137,3 +162,12 @@ defaultLayoutSub :: Yesod parent
=> WidgetT child IO ()
-> HandlerT child (HandlerT parent IO) Html
defaultLayoutSub cwidget = widgetToParentWidget cwidget >>= lift . defaultLayout
showIntegral :: Integral a => a -> String
showIntegral x = show (fromIntegral x :: Integer)
readIntegral :: Num a => String -> Maybe a
readIntegral s =
case reads s of
(i, _):_ -> Just $ fromInteger i
[] -> Nothing

View File

@ -6,43 +6,8 @@ module Yesod
module Yesod.Core
, module Yesod.Form
, module Yesod.Persist
-- * Commonly referenced functions/datatypes
, Application
-- * Utilities
, showIntegral
, readIntegral
-- * Hamlet library
-- ** Hamlet
, hamlet
, xhamlet
, HtmlUrl
-- ** Julius
, julius
, JavascriptUrl
, renderJavascriptUrl
-- ** Cassius/Lucius
, cassius
, lucius
, CssUrl
, renderCssUrl
) where
import Yesod.Core
import Text.Hamlet
import Text.Cassius
import Text.Lucius
import Text.Julius
import Yesod.Form
import Yesod.Persist
import Network.Wai
showIntegral :: Integral a => a -> String
showIntegral x = show (fromIntegral x :: Integer)
readIntegral :: Num a => String -> Maybe a
readIntegral s =
case reads s of
(i, _):_ -> Just $ fromInteger i
[] -> Nothing

View File

@ -1,5 +1,5 @@
name: yesod
version: 1.2.0.1
version: 1.2.1
license: MIT
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>
@ -22,7 +22,7 @@ library
cpp-options: -DWINDOWS
build-depends: base >= 4.3 && < 5
, yesod-core >= 1.2 && < 1.3
, yesod-core >= 1.2.2 && < 1.3
, yesod-auth >= 1.2 && < 1.3
, yesod-persistent >= 1.2 && < 1.3
, yesod-form >= 1.3 && < 1.4