Module
Routing.Match.Class
- Package
- purescript-routing
- Repository
- slamdata/purescript-routing
#MatchClass Source
class (Alternative f) <= MatchClass f whereMembers
lit :: String -> f Unitstr :: f Stringstrmatches any path string component. For example,strmatches/fooas"foo".param :: String -> f Stringparam pmatches a parameter assignmentq=vwithin a query block. For example,param "q"matches/?q=a&r=bas"a".params :: f (Map String String)paramsmatches an entire query block. For exmaple,paramsmatches/?q=a&r=bas the map{q : "a", r : "b"}. Note thatlit "foo" *> paramsdoes not match/foo, since a query component is required.num :: f Numbernummatches any numerical path component.int :: f Intintmatches any integer path component.bool :: f Booleanboolmatches any boolean path component.end :: f Unitendmatches the end of a route.fail :: forall a. String -> f a
#root Source
root :: forall f. MatchClass f => f UnitMatches a leading slash.
lit xwill match exactly the path componentx. For example,lit "x"matches/x.