| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Path.Extended
Synopsis
- data Location = Location {
- locPath :: Either (Path Abs Dir) (Path Abs File)
- locQueryParams :: [QueryParam]
- locFragment :: Maybe String
- type QueryParam = (String, Maybe String)
- class ToPath sym base type' | sym -> base type' where
- class ToLocation sym where
- class FromPath sym base type' | sym -> base type' where
- class FromLocation sym where
- fromAbsDir :: Path Abs Dir -> Location
- fromAbsFile :: Path Abs File -> Location
- prepend :: Path Abs Dir -> Location -> Location
- setQuery :: [QueryParam] -> Location -> Location
- addQuery :: QueryParam -> Location -> Location
- (<&>) :: Location -> QueryParam -> Location
- addQueries :: [QueryParam] -> Location -> Location
- delQuery :: Location -> Location
- getQuery :: Location -> [QueryParam]
- setFragment :: Maybe String -> Location -> Location
- addFragment :: String -> Location -> Location
- (<#>) :: Location -> String -> Location
- delFragment :: Location -> Location
- getFragment :: Location -> Maybe String
- locationParser :: Parser Location
- printLocation :: Location -> Text
Types
A location for some base and type - internally uses Path.
Constructors
| Location | |
Fields
| |
Instances
| Eq Location # | |
| Ord Location # | |
Defined in Path.Extended | |
| Generic Location # | |
| type Rep Location # | |
Defined in Path.Extended type Rep Location = D1 (MetaData "Location" "Path.Extended" "path-extra-0.2.0-IkFEqDVc3DEEMBXbYhUA8K" False) (C1 (MetaCons "Location" PrefixI True) (S1 (MetaSel (Just "locPath") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Either (Path Abs Dir) (Path Abs File))) :*: (S1 (MetaSel (Just "locQueryParams") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [QueryParam]) :*: S1 (MetaSel (Just "locFragment") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String))))) | |
type QueryParam = (String, Maybe String) #
Classes
class ToPath sym base type' | sym -> base type' where #
Convenience typeclass for symbolic, stringless routes - make an instance for your own data type to use your constructors as route-referencing symbols.
Minimal complete definition
class ToLocation sym where #
Convenience typeclass for symbolic, stringless routes - make an instance for your own data type to use your constructors as route-referencing symbols.
Minimal complete definition
Methods
toLocation :: sym -> Location #
class FromLocation sym where #
Minimal complete definition
Methods
parseLocation :: Location -> Either String sym #
Combinators
Path
Query Parameters
setQuery :: [QueryParam] -> Location -> Location #
addQuery :: QueryParam -> Location -> Location #
Appends a query parameter
(<&>) :: Location -> QueryParam -> Location infixl 7 #
addQueries :: [QueryParam] -> Location -> Location #
getQuery :: Location -> [QueryParam] #
Fragment
addFragment :: String -> Location -> Location #
delFragment :: Location -> Location #
getFragment :: Location -> Maybe String #
Parser & Printer
printLocation :: Location -> Text #