@@ -611,18 +611,19 @@ class CookieAuthNotEnabled
611611-}
612612
613613-- | Change a 'Throws' into 'Throwing'.
614−instance (HasClient t m (Throwing '[e] :> api) tag) => HasClient t m (Throws e :> api) tag where
614+instance (Monad m, HasClient t m (Throwing '[e] :> api) tag) => HasClient t m (Throws e :> api) tag where
615615 type Client t m (Throws e :> api) tag = Client t m (Throwing '[e] :> api) tag
616616
617− clientWithRoute
617+ clientWithRouteAndResultHandler
618618 :: Proxy (Throws e :> api)
619619 -> Proxy m
620620 -> Proxy tag
621621 -> Req t
622622 -> Dynamic t BaseUrl
623623 -> ClientOptions
624+ -> (forall a. Event t (ReqResult tag a) -> m (Event t (ReqResult tag a)))
624625 -> Client t m (Throwing '[e] :> api) tag
625− clientWithRoute _ = clientWithRoute (Proxy :: Proxy (Throwing '[e] :> api))
626+ clientWithRouteAndResultHandler _ = clientWithRouteAndResultHandler (Proxy :: Proxy (Throwing '[e] :> api))
626627
627628-- | When @'Throwing' es@ comes before a 'Verb', change it into the same 'Verb'
628629-- but returning an @'Envelope' es@.
@@ -632,110 +633,116 @@ instance (HasClient t m (Verb method status ctypes (Envelope es a)) tag) =>
632633 type Client t m (Throwing es :> Verb method status ctypes a) tag =
633634 Client t m (Verb method status ctypes (Envelope es a)) tag
634635
635− clientWithRoute
636+ clientWithRouteAndResultHandler
636637 :: Proxy (Throwing es :> Verb method status ctypes a)
637638 -> Proxy m
638639 -> Proxy tag
639640 -> Req t
640641 -> Dynamic t BaseUrl
641642 -> ClientOptions
643+ -> (forall x. Event t (ReqResult tag x) -> m (Event t (ReqResult tag x)))
642644 -> Client t m (Verb method status ctypes (Envelope es a)) tag
643− clientWithRoute Proxy =
644− clientWithRoute (Proxy :: Proxy (Verb method status ctypes (Envelope es a)))
645+ clientWithRouteAndResultHandler Proxy =
646+ clientWithRouteAndResultHandler (Proxy :: Proxy (Verb method status ctypes (Envelope es a)))
645647
646648-- | When 'NoThrow' comes before a 'Verb', change it into the same 'Verb'
647649-- but returning an @'Envelope' \'[]@.
648−instance (HasClient t m (Verb method status ctypes (Envelope '[] a)) tag) =>
650+instance (Monad m, HasClient t m (Verb method status ctypes (Envelope '[] a)) tag) =>
649651 HasClient t m (NoThrow :> Verb method status ctypes a) tag where
650652
651653 type Client t m (NoThrow :> Verb method status ctypes a) tag =
652654 Client t m (Verb method status ctypes (Envelope '[] a)) tag
653655
654− clientWithRoute
656+ clientWithRouteAndResultHandler
655657 :: Proxy (NoThrow :> Verb method status ctypes a)
656658 -> Proxy m
657659 -> Proxy tag
658660 -> Req t
659661 -> Dynamic t BaseUrl
660662 -> ClientOptions
663+ -> (forall x. Event t (ReqResult tag x) -> m (Event t (ReqResult tag x)))
661664 -> Client t m (Verb method status ctypes (Envelope '[] a)) tag
662− clientWithRoute Proxy =
663− clientWithRoute (Proxy :: Proxy (Verb method status ctypes (Envelope '[] a)))
665+ clientWithRouteAndResultHandler Proxy =
666+ clientWithRouteAndResultHandler (Proxy :: Proxy (Verb method status ctypes (Envelope '[] a)))
664667
665668-- | When @'Throwing' es@ comes before ':<|>', push @'Throwing' es@ into each
666669-- branch of the API.
667−instance HasClient t m ((Throwing es :> api1) :<|> (Throwing es :> api2)) tag =>
670+instance (Monad m, HasClient t m ((Throwing es :> api1) :<|> (Throwing es :> api2)) tag) =>
668671 HasClient t m (Throwing es :> (api1 :<|> api2)) tag where
669672
670673 type Client t m (Throwing es :> (api1 :<|> api2)) tag =
671674 Client t m ((Throwing es :> api1) :<|> (Throwing es :> api2)) tag
672675
673− clientWithRoute
676+ clientWithRouteAndResultHandler
674677 :: Proxy (Throwing es :> (api1 :<|> api2))
675678 -> Proxy m
676679 -> Proxy tag
677680 -> Req t
678681 -> Dynamic t BaseUrl
679682 -> ClientOptions
683+ -> (forall a. Event t (ReqResult tag a) -> m (Event t (ReqResult tag a)))
680684 -> Client t m ((Throwing es :> api1) :<|> (Throwing es :> api2)) tag
681− clientWithRoute _ =
682− clientWithRoute (Proxy :: Proxy ((Throwing es :> api1) :<|> (Throwing es :> api2)))
685+ clientWithRouteAndResultHandler _ =
686+ clientWithRouteAndResultHandler (Proxy :: Proxy ((Throwing es :> api1) :<|> (Throwing es :> api2)))
683687
684688-- | When 'NoThrow' comes before ':<|>', push 'NoThrow' into each branch of the
685689-- API.
686−instance HasClient t m ((NoThrow :> api1) :<|> (NoThrow :> api2)) tag =>
690+instance (Monad m, HasClient t m ((NoThrow :> api1) :<|> (NoThrow :> api2)) tag) =>
687691 HasClient t m (NoThrow :> (api1 :<|> api2)) tag where
688692
689693 type Client t m (NoThrow :> (api1 :<|> api2)) tag =
690694 Client t m ((NoThrow :> api1) :<|> (NoThrow :> api2)) tag
691695
692− clientWithRoute
696+ clientWithRouteAndResultHandler
693697 :: Proxy (NoThrow :> (api1 :<|> api2))
694698 -> Proxy m
695699 -> Proxy tag
696700 -> Req t
697701 -> Dynamic t BaseUrl
698702 -> ClientOptions
703+ -> (forall a. Event t (ReqResult tag a) -> m (Event t (ReqResult tag a)))
699704 -> Client t m ((NoThrow :> api1) :<|> (NoThrow :> api2)) tag
700− clientWithRoute _ =
701− clientWithRoute (Proxy :: Proxy ((NoThrow :> api1) :<|> (NoThrow :> api2)))
705+ clientWithRouteAndResultHandler _ =
706+ clientWithRouteAndResultHandler (Proxy :: Proxy ((NoThrow :> api1) :<|> (NoThrow :> api2)))
702707
703708-- | When a @'Throws' e@ comes immediately after a @'Throwing' es@, 'Snoc' the
704709-- @e@ onto the @es@. Otherwise, if @'Throws' e@ comes before any other
705710-- combinator, push it down so it is closer to the 'Verb'.
706−instance HasClient t m (ThrowingNonterminal (Throwing es :> api :> apis)) tag =>
711+instance (Monad m, HasClient t m (ThrowingNonterminal (Throwing es :> api :> apis)) tag) =>
707712 HasClient t m (Throwing es :> api :> apis) tag where
708713
709714 type Client t m (Throwing es :> api :> apis) tag =
710715 Client t m (ThrowingNonterminal (Throwing es :> api :> apis)) tag
711716
712− clientWithRoute
717+ clientWithRouteAndResultHandler
713718 :: Proxy (Throwing es :> api :> apis)
714719 -> Proxy m
715720 -> Proxy tag
716721 -> Req t
717722 -> Dynamic t BaseUrl
718723 -> ClientOptions
724+ -> (forall a. Event t (ReqResult tag a) -> m (Event t (ReqResult tag a)))
719725 -> Client t m (ThrowingNonterminal (Throwing es :> api :> apis)) tag
720− clientWithRoute _ =
721− clientWithRoute (Proxy :: Proxy (ThrowingNonterminal (Throwing es :> api :> apis)))
726+ clientWithRouteAndResultHandler _ =
727+ clientWithRouteAndResultHandler (Proxy :: Proxy (ThrowingNonterminal (Throwing es :> api :> apis)))
722728
723729-- | When 'NoThrow' comes before any other combinator, push it down so it is
724730-- closer to the 'Verb'.
725−instance HasClient t m (api :> NoThrow :> apis) tag =>
731+instance (Monad m, HasClient t m (api :> NoThrow :> apis) tag) =>
726732 HasClient t m (NoThrow :> api :> apis) tag where
727733
728734 type Client t m (NoThrow :> api :> apis) tag =
729735 Client t m (api :> NoThrow :> apis) tag
730736
731− clientWithRoute
737+ clientWithRouteAndResultHandler
732738 :: Proxy (NoThrow :> api :> apis)
733739 -> Proxy m
734740 -> Proxy tag
735741 -> Req t
736742 -> Dynamic t BaseUrl
737743 -> ClientOptions
744+ -> (forall a. Event t (ReqResult tag a) -> m (Event t (ReqResult tag a)))
738745 -> Client t m (api :> NoThrow :> apis) tag
739− clientWithRoute _ =
740− clientWithRoute (Proxy :: Proxy (api :> NoThrow :> apis))
746+ clientWithRouteAndResultHandler _ =
747+ clientWithRouteAndResultHandler (Proxy :: Proxy (api :> NoThrow :> apis))
741748