hitPattern (Just pat) path = ((unpack $ "/" ++ pat ++ "_") `isInfixOf` path')
                          || ((unpack $ "/" ++ pat ++ "/") `isInfixOf` path')
  where
    path' = encodeString path
hitPattern (Just pat) path = ((unpack $ "/" ++ pat ++ "_") `isInfixOf` path')
                          || ((unpack $ "/" ++ pat ++ "/") `isInfixOf` path')
  where
    path' = encodeString path
hitPattern (Just pat) path = ((unpack $ "/" ++ pat ++ "_") `isInfixOf` path')
                          || ((unpack $ "/" ++ pat ++ "/") `isInfixOf` path')
  where
    path' = encodeString path