Module

Routing.Duplex.Generic

Package
purescript-routing-duplex
Repository
natefaubion/purescript-routing-duplex

#sum Source

sum :: forall a rep r. Generic a rep => GRouteDuplex rep r => Record r -> RouteDuplex' a

Builds a parser/printer from a record, where each record field corresponds to a constructor name for your data type.

Note: this implicitly inserts calls to end for each constructor, making the parser only valid for parsing URI suffixes. To parse URI prefixes, or to just have more explicit control, use sumPrefix.

#sumPrefix Source

sumPrefix :: forall a rep r. Generic a rep => GRouteDuplex rep r => Record r -> RouteDuplex' a

A variation of sum that does not implicitly add an end to each branch. This is useful for defining sub-parsers that may consume only some of the URI segments, leaving the rest for subsequent parsers.

#GRouteDuplex Source

class GRouteDuplex :: Type -> Row Type -> Constraintclass GRouteDuplex rep (r :: Row Type) | rep -> r where

Members

Instances

#product Source

#(~) Source

Operator alias for Routing.Duplex.Generic.product (right-associative / precedence 0)