diff --git a/src/Vervis/Application.hs b/src/Vervis/Application.hs index 2044439..63bb223 100644 --- a/src/Vervis/Application.hs +++ b/src/Vervis/Application.hs @@ -326,5 +326,5 @@ handler :: Handler a -> IO a handler h = getAppSettings >>= makeFoundation >>= flip unsafeHandler h -- | Run DB queries -db :: ReaderT SqlBackend (HandlerT App IO) a -> IO a +db :: ReaderT SqlBackend (HandlerFor App) a -> IO a db = handler . runDB diff --git a/src/Vervis/Foundation.hs b/src/Vervis/Foundation.hs index f96e168..6b7ab45 100644 --- a/src/Vervis/Foundation.hs +++ b/src/Vervis/Foundation.hs @@ -135,12 +135,12 @@ type LocalMessageKeyHashid = KeyHashid LocalMessage -- http://www.yesodweb.com/book/scaffolding-and-the-site-template#scaffolding-and-the-site-template_foundation_and_application_modules -- -- This function also generates the following type synonyms: --- type Handler = HandlerT App IO --- type Widget = WidgetT App IO () +-- type Handler = HandlerFor App +-- type Widget = WidgetFor App () mkYesodData "App" $(parseRoutesFile "config/routes") -- | A convenient synonym for creating forms. -type Form a = Html -> MForm (HandlerT App IO) (FormResult a, Widget) +type Form a = Html -> MForm (HandlerFor App) (FormResult a, Widget) type AppDB = YesodDB App diff --git a/src/Vervis/Paginate.hs b/src/Vervis/Paginate.hs index 0c4bee0..4f7906a 100644 --- a/src/Vervis/Paginate.hs +++ b/src/Vervis/Paginate.hs @@ -34,7 +34,6 @@ import Data.Traversable import Formatting (sformat, stext, int, (%)) import Yesod.Core import Yesod.Core.Handler -import Yesod.Core.Widget (WidgetT) import qualified Data.Text as T (null, pack) import qualified Data.Text.Read as TR (decimal) @@ -106,7 +105,7 @@ getPageAndNavTop -> m (Int, Int, f i, NavModel) getPageAndNavTop select = paginateTop (paginateSettings select) navSettings -navWidget :: NavModel -> WidgetT site IO () +navWidget :: NavModel -> WidgetFor site () navWidget nm = do route <- fromMaybe (error "Pagination in invalid response content") <$> diff --git a/src/Vervis/Widget.hs b/src/Vervis/Widget.hs index bb80ee8..43ca855 100644 --- a/src/Vervis/Widget.hs +++ b/src/Vervis/Widget.hs @@ -40,12 +40,12 @@ import Vervis.Settings (widgetFile) import Vervis.Style import Vervis.Time (showDate) -breadcrumbsW :: YesodBreadcrumbs site => WidgetT site IO () +breadcrumbsW :: YesodBreadcrumbs site => WidgetFor site () breadcrumbsW = do (current, bcs) <- handlerToWidget breadcrumbs $(widgetFile "widget/breadcrumbs") -revisionW :: WidgetT site IO () +revisionW :: WidgetFor site () revisionW = let cgTimeFmt = showDate . cgTime mrev = $darcsRevision @@ -54,7 +54,7 @@ revisionW = changes = $darcsTotalPatches :: Int in $(widgetFile "widget/revision") -avatarW :: Bool -> Text -> WidgetT site IO () +avatarW :: Bool -> Text -> WidgetFor site () avatarW secure email = do murl <- getAvatarUrl secure email [whamlet| @@ -65,7 +65,7 @@ avatarW secure email = do
INVALID EMAIL |] -buttonW :: StdMethod -> Text -> Route site -> WidgetT site IO () +buttonW :: StdMethod -> Text -> Route site -> WidgetFor site () buttonW method content route = do let tokenKey = defaultCsrfParamName mtoken <- reqToken <$> getRequest diff --git a/src/Yesod/Paginate/Local.hs b/src/Yesod/Paginate/Local.hs index f4d70a9..143d454 100644 --- a/src/Yesod/Paginate/Local.hs +++ b/src/Yesod/Paginate/Local.hs @@ -34,7 +34,7 @@ import Data.Default.Class import Data.Text (Text) import Text.Blaze (ToMarkup) import Yesod.Core -import Yesod.Core.Widget (WidgetT, whamlet) +import Yesod.Core.Widget import qualified Data.Text as T (pack) import qualified Formatting as F @@ -76,7 +76,7 @@ pageNavWidget => NavModel -> NavWidgetSettings -> (Int -> (Route site, t)) - -> WidgetT site IO () + -> WidgetFor site () pageNavWidget nm nws mklink = let link n label = let (route, suffix) = mklink n