path-extra-0.0.3: Chris Done's path library, enriched with URL-related goodies.

Safe HaskellNone
LanguageHaskell2010

Path.Extended

Contents

Synopsis

Types

data Location b t Source

A location for some base and type - internally uses Path.

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.

Methods

toPath :: MonadThrow m => sym -> m (Path base type') Source

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.

Methods

toLocation :: MonadThrow m => sym -> m (Location base type') Source

Combinators

Append

class PathAppend right base type' where Source

Methods

(</>) :: Path base Dir -> right Rel type' -> right base type' Source

Instances

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

addParent :: Location Rel t -> Location Rel t Source

Prepend a parental accessor path - ../

delParent :: Location Rel t -> Location Rel t Source

Path

fromPath :: Path b t -> Location b t Source

This should be your entry point for creating a Location.

File Extensions

addFileExt :: String -> Location b File -> Location b File Source

delFileExt :: Location b File -> Location b File Source

Query Parameters

addQuery :: QueryParam -> Location b t -> Location b t Source

Appends a query parameter

(<&>) :: Location b t -> QueryParam -> Location b t infixl 7 Source

Fragment

(<#>) :: Location b t -> String -> Location b t infixl 8 Source