- = proc (name, fpath) ->
- do tree <- readFromDocument [ (a_validate , v_0)
- , (a_check_namespaces , v_1)
- , (a_remove_whitespace, v_1)
- ] -< fpath
- lastMod <- arrIO (\ x -> getFileStatus x
- >>=
- return . posixSecondsToUTCTime . fromRational . toRational . modificationTime)
- -< fpath
- page <- parseXmlizedPage -< (name, tree)
-
- case page of
- Redirection _ _ _ _ _
- -> returnA -< page {
- redirRevision = 0
- , redirLastMod = lastMod
- }
-
- Entity _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- -> returnA -< page {
- entityRevision = 0
- , entityLastMod = lastMod
- }
+ = proc (name, fpath) →
+ do tree ← readFromDocument [ withValidate no
+ , withCheckNamespaces yes
+ , withRemoveWS yes
+ ] ⤙ fpath
+ lastMod ← arrIO ( \x → getFileStatus x
+ ≫=
+ pure ∘ posixSecondsToUTCTime ∘ fromRational ∘ toRational ∘ modificationTime
+ ) ⤙ fpath
+ page ← parseXmlizedPage ⤙ (name, tree)
+ if isEntity page then
+ returnA ⤙ page {
+ entityRevision = 0
+ , entityLastMod = lastMod
+ }
+ else
+ returnA ⤙ page {
+ redirRevision = 0
+ , redirLastMod = lastMod
+ }