on master help sign in
Update recentFirst usage in tutorial 5
a729060Jasper Van der Jeugt
web/tutorials/05-snapshots-feeds.markdown+3−2
@@ -51,7 +51,7 @@ create ["atom.xml"] $ do
51 let feedCtx = postCtx `mappend`
51 let feedCtx = postCtx `mappend`
52 constField "description" "This is the post description"
52 constField "description" "This is the post description"
53
53
54− posts <- take 10 . recentFirst <$> loadAll "posts/*"
54+ posts <- fmap (take 10) . recentFirst =<< loadAll "posts/*"
55 renderAtom myFeedConfiguration feedCtx posts
55 renderAtom myFeedConfiguration feedCtx posts
56```
56```
57
57
@@ -122,6 +122,7 @@ create ["atom.xml"] $ do
122 route idRoute
122 route idRoute
123 compile $ do
123 compile $ do
124 let feedCtx = postCtx `mappend` bodyField "description"
124 let feedCtx = postCtx `mappend` bodyField "description"
125+ posts <- fmap (take 10) . recentFirst =<<
125− posts <- take 10 . recentFirst <$> loadAllSnapshots "posts/*" "content"
126+ loadAllSnapshots "posts/*" "content"
126 renderAtom myFeedConfiguration feedCtx posts
127 renderAtom myFeedConfiguration feedCtx posts
127```
128```