Module
Jarilo.Segment
- Package
- purescript-jarilo
- Repository
- bklaric/purescript-jarilo
#Capture Source
data Capture :: Symbol -> Type -> Segment
Instances
(IsSymbol name, Lacks name input, Cons name value input output, FromComponent value) => SegmentRouter (Capture name value) input output
#SegmentError Source
data SegmentError
Constructors
LiteralError { actualLiteral :: PathSegment, expectedLiteral :: PathSegment }
CaptureError { actualSegment :: PathSegment, errorMessage :: String, segmentName :: String }
#SegmentRouter Source
class SegmentRouter (segment :: Segment) (input :: Row Type) (output :: Row Type) | segment -> input output where
Members
segmentRouter :: forall errors. SegmentProxy segment -> PathSegment -> Either (Variant (segmentError :: SegmentError | errors)) (Builder (Record input) (Record output))
Instances
(IsSymbol literal) => SegmentRouter (Literal literal) input input
(IsSymbol name, Lacks name input, Cons name value input output, FromComponent value) => SegmentRouter (Capture name value) input output