Module
Yoga.Fetch.Om.SplitResponses
- Package
- purescript-yoga-fetch-om
- Repository
- rowtype-yoga/purescript-yoga-fetch-om
#IsSuccessStatus Source
class IsSuccessStatus :: Symbol -> Boolean -> Constraintclass IsSuccessStatus (label :: Symbol) (isSuccess :: Boolean) | label -> isSuccess
Instances
IsSuccessStatus "ok" TrueIsSuccessStatus "created" TrueIsSuccessStatus "accepted" TrueIsSuccessStatus "nonAuthoritativeInformation" TrueIsSuccessStatus "noContent" TrueIsSuccessStatus "resetContent" TrueIsSuccessStatus "partialContent" TrueIsSuccessStatus "multiStatus" TrueIsSuccessStatus "alreadyReported" TrueIsSuccessStatus "imUsed" TrueIsSuccessStatus label False
#ExtractBody Source
class ExtractBody (responseType :: Type) (bodyType :: Type) | responseType -> bodyTypeInstances
ExtractBody (Response headers body) body(Cons "body" body rest row) => ExtractBody (Record row) body
#SplitResponses Source
class SplitResponses :: Row Type -> Row Type -> Row Type -> Constraintclass SplitResponses (allRow :: Row Type) (successRow :: Row Type) (errorRow :: Row Type) | allRow -> successRow errorRow
Instances
(RowToList allRow rl, SplitResponsesRL rl successRow errorRow) => SplitResponses allRow successRow errorRow
#SplitResponsesRL Source
class SplitResponsesRL :: RowList Type -> Row Type -> Row Type -> Constraintclass SplitResponsesRL (rl :: RowList Type) (successRow :: Row Type) (errorRow :: Row Type) | rl -> successRow errorRow
Instances
SplitResponsesRL Nil () ()(IsSuccessStatus label isSuccess, ExtractBody ty body, SplitResponsesRL tail successTail errorTail, DispatchResponse isSuccess label body successTail errorTail successRow errorRow) => SplitResponsesRL (Cons label ty tail) successRow errorRow
#DispatchResponse Source
class DispatchResponse :: Boolean -> Symbol -> Type -> Row Type -> Row Type -> Row Type -> Row Type -> Constraintclass DispatchResponse (isSuccess :: Boolean) (label :: Symbol) (body :: Type) (successTail :: Row Type) (errorTail :: Row Type) (successRow :: Row Type) (errorRow :: Row Type) | isSuccess label body successTail errorTail -> successRow errorRow
Instances
(Cons label body successTail successRow, Lacks label successTail) => DispatchResponse True label body successTail errorTail successRow errorTail(Cons label body errorTail errorRow, Lacks label errorTail) => DispatchResponse False label body successTail errorTail successTail errorRow