Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Location b t
- type QueryParam = (String, Maybe String)
- class ToPath sym base type' | sym -> base type' where
- toPath :: MonadThrow m => sym -> m (Path base type')
- class ToLocation sym base type' | sym -> base type' where
- toLocation :: MonadThrow m => sym -> m (Location base type')
- class PathAppend right base type' where
- (</>) :: Path base Dir -> right Rel type' -> right base type'
- addParent :: Location Rel t -> Location Rel t
- delParent :: Location Rel t -> Location Rel t
- fromPath :: Path b t -> Location b t
- setFileExt :: Maybe String -> Location b File -> Location b File
- addFileExt :: String -> Location b File -> Location b File
- delFileExt :: Location b File -> Location b File
- getFileExt :: Location b File -> Maybe String
- setQuery :: [QueryParam] -> Location b t -> Location b t
- addQuery :: QueryParam -> Location b t -> Location b t
- (<&>) :: Location b t -> QueryParam -> Location b t
- addQueries :: [QueryParam] -> Location b t -> Location b t
- delQuery :: Location b t -> Location b t
- getQuery :: Location b t -> [QueryParam]
- setFragment :: Maybe String -> Location b t -> Location b t
- addFragment :: String -> Location b t -> Location b t
- (<#>) :: Location b t -> String -> Location b t
- delFragment :: Location b t -> Location b t
Types
A location for some base and type - internally uses Path
.
type QueryParam = (String, Maybe String) Source
Classes
class ToPath sym base type' | sym -> base type' where Source
Convenience typeclass for symbolic, stringless routes - make an instance for your own data type to use your constructors as route-referencing symbols.
class ToLocation sym base type' | sym -> base type' where Source
Convenience typeclass for symbolic, stringless routes - make an instance for your own data type to use your constructors as route-referencing symbols.
toLocation :: MonadThrow m => sym -> m (Location base type') Source
Combinators
Append
class PathAppend right base type' where Source
PathAppend Path Rel File Source | |
PathAppend Path Rel Dir Source | |
PathAppend Path Abs File Source | |
PathAppend Path Abs Dir Source | |
PathAppend Location Rel File Source | |
PathAppend Location Rel Dir Source | |
PathAppend Location Abs File Source | |
PathAppend Location Abs Dir Source |
Parent Accessors
Path
File Extensions
addFileExt :: String -> Location b File -> Location b File Source
delFileExt :: Location b File -> Location b File Source
getFileExt :: Location b File -> Maybe String Source
Query Parameters
setQuery :: [QueryParam] -> Location b t -> Location b t Source
addQuery :: QueryParam -> Location b t -> Location b t Source
Appends a query parameter
(<&>) :: Location b t -> QueryParam -> Location b t infixl 7 Source
addQueries :: [QueryParam] -> Location b t -> Location b t Source
getQuery :: Location b t -> [QueryParam] Source
Fragment
addFragment :: String -> Location b t -> Location b t Source
delFragment :: Location b t -> Location b t Source