panda-2008.10.17: Panda/Helper/StateHelper.hs
-- trying to merge this helper with the generic one results in cyclic imports
{-# OPTIONS -fno-monomorphism-restriction #-}
module Panda.Helper.StateHelper where
import Panda.Helper.Env
import qualified Panda.Config.Global as G
import Prelude hiding ((.), (/), (^), id)
-- G.root = /blog
-- raw_uri = blog/x
-- full_uri = /blog/x
-- uri = full_uri - (/blog/)
remove_root s
| G.root.is "/" = s
| otherwise = s.slice (G.root.length) (s.length)
uri = raw_uri ^ remove_root
-- uri = raw_uri