Module
Routing.Match.Class
- Package
- purescript-routing
- Repository
- slamdata/purescript-routing
#MatchClass Source
class (Alternative f) <= MatchClass f where
Members
lit :: String -> f Unit
str :: f String
str
matches any path string component. For example,str
matches/foo
as"foo"
.param :: String -> f String
param p
matches a parameter assignmentq=v
within a query block. For example,param "q"
matches/?q=a&r=b
as"a"
.params :: f (Map String String)
params
matches an entire query block. For exmaple,params
matches/?q=a&r=b
as the map{q : "a", r : "b"}
. Note thatlit "foo" *> params
does not match/foo
, since a query component is required.num :: f Number
num
matches any numerical path component.int :: f Int
int
matches any integer path component.bool :: f Boolean
bool
matches any boolean path component.end :: f Unit
end
matches the end of a route.fail :: forall a. String -> f a
lit x
will match exactly the path componentx
. For example,lit "x"
matches/x
.