forM -> traverse

This commit is contained in:
Pagwin 2025-12-11 15:52:46 -05:00
parent 667477e01d
commit 35e55b0e43
No known key found for this signature in database
GPG key ID: 81137023740CA260

View file

@ -8,11 +8,12 @@
module Psb.Main where
import Config
import Control.Monad (forM, when)
import Control.Monad (when)
import qualified Data.HashMap.Strict as HM
import Data.List (sortOn)
import qualified Data.Ord as Ord
import qualified Data.Text as T
import Data.Traversable (traverse)
import Deriving.Aeson
import Deriving.Aeson.Stock (Vanilla)
import Development.Shake (Action, Rules, (%>), (|%>), (~>))
@ -121,7 +122,7 @@ home =
postPaths <- getPublishedPosts isDraft
posts <-
sortOn (Ord.Down . postDate)
<$> forM postPaths readPost
<$> traverse readPost postPaths
let posts' = map fromPost posts
html <- applyTemplate "home.html" $ HM.singleton "posts" posts'
time <- Utilities.Action.now