Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
remove evalOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
sophicshift committed Sep 26, 2023
1 parent 472df2b commit f24b37b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
8 changes: 0 additions & 8 deletions ema-org/src/Site/Org/Render.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module Site.Org.Render (
)
where

import Control.Monad.Trans.Either (runEitherT)
import Data.IxSet.Typed qualified as Ix
import Data.Map qualified as Map
import Ema (Asset (AssetGenerated), Format (Html), routeUrl)
Expand Down Expand Up @@ -54,13 +53,6 @@ pageExp rp pgs page = do
bk = backend pgs rp
router = routeUrl rp

evalOutput :: RenderM m => OndimState -> Ondim a -> m (Either OndimException a)
evalOutput ostate content = do
let RenderT out = evalOndimTWith ostate content
collapse <$> runEitherT out
where
collapse = fromRight (error "")

renderPost :: Identifier -> Prism' FilePath Route -> Model -> Ondim (Asset LByteString)
renderPost identifier rp m = do
lPage :: [HtmlDocument] <-
Expand Down
3 changes: 1 addition & 2 deletions organon/src/Site/Organon/Route.hs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,9 @@ instance EmaSite Route where
where
files = keys model.static.modelFiles

render :: RenderM m => Ondim (Asset LByteString) -> m (Asset LByteString)
render res =
either handleErrors return
=<< evalOutput ostate (res `binding` globalExps)
=<< unRenderT (evalOndimTWith ostate (res `binding` globalExps))
where
handleErrors e = do
let msg = prettyException e
Expand Down

0 comments on commit f24b37b

Please sign in to comment.