, pageName
, pageUpdateInfo
+ , pageRevision
, encodePageName
, decodePageName
pageName p
| isRedirect p = redirName p
| isEntity p = entityName p
- | otherwise = fail "neither redirection nor entity"
+ | otherwise = error "neither redirection nor entity"
pageUpdateInfo :: Page -> Maybe UpdateInfo
pageUpdateInfo p
| isRedirect p = redirUpdateInfo p
| isEntity p = entityUpdateInfo p
- | otherwise = fail "neither redirection nor entity"
+ | otherwise = error "neither redirection nor entity"
+
+
+pageRevision :: Page -> RevNum
+pageRevision p
+ | isRedirect p = redirRevision p
+ | isEntity p = entityRevision p
+ | otherwise = error "neither redirection nor entity"
-- UTF-8 に encode してから 0x20 - 0x7E の範圍を除いて URI escape する。