on master help sign in
Fix merge of master into text-jsstring
e18d6bdKen Micklas
src/Servant/Reflex.hs+33−26
@@ -611,18 +611,19 @@ class CookieAuthNotEnabled
611-}
611-}
612
612
613-- | Change a 'Throws' into 'Throwing'.
613-- | 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
615 type Client t m (Throws e :> api) tag = Client t m (Throwing '[e] :> api) tag
615 type Client t m (Throws e :> api) tag = Client t m (Throwing '[e] :> api) tag
616
616
617− clientWithRoute
617+ clientWithRouteAndResultHandler
618 :: Proxy (Throws e :> api)
618 :: Proxy (Throws e :> api)
619 -> Proxy m
619 -> Proxy m
620 -> Proxy tag
620 -> Proxy tag
621 -> Req t
621 -> Req t
622 -> Dynamic t BaseUrl
622 -> Dynamic t BaseUrl
623 -> ClientOptions
623 -> ClientOptions
624+ -> (forall a. Event t (ReqResult tag a) -> m (Event t (ReqResult tag a)))
624 -> Client t m (Throwing '[e] :> api) tag
625 -> Client t m (Throwing '[e] :> api) tag
625− clientWithRoute _ = clientWithRoute (Proxy :: Proxy (Throwing '[e] :> api))
626+ clientWithRouteAndResultHandler _ = clientWithRouteAndResultHandler (Proxy :: Proxy (Throwing '[e] :> api))
626
627
627-- | When @'Throwing' es@ comes before a 'Verb', change it into the same 'Verb'
628-- | When @'Throwing' es@ comes before a 'Verb', change it into the same 'Verb'
628-- but returning an @'Envelope' es@.
629-- but returning an @'Envelope' es@.
@@ -632,110 +633,116 @@ instance (HasClient t m (Verb method status ctypes (Envelope es a)) tag) =>
632 type Client t m (Throwing es :> Verb method status ctypes a) tag =
633 type Client t m (Throwing es :> Verb method status ctypes a) tag =
633 Client t m (Verb method status ctypes (Envelope es a)) tag
634 Client t m (Verb method status ctypes (Envelope es a)) tag
634
635
635− clientWithRoute
636+ clientWithRouteAndResultHandler
636 :: Proxy (Throwing es :> Verb method status ctypes a)
637 :: Proxy (Throwing es :> Verb method status ctypes a)
637 -> Proxy m
638 -> Proxy m
638 -> Proxy tag
639 -> Proxy tag
639 -> Req t
640 -> Req t
640 -> Dynamic t BaseUrl
641 -> Dynamic t BaseUrl
641 -> ClientOptions
642 -> ClientOptions
643+ -> (forall x. Event t (ReqResult tag x) -> m (Event t (ReqResult tag x)))
642 -> Client t m (Verb method status ctypes (Envelope es a)) tag
644 -> Client t m (Verb method status ctypes (Envelope es a)) tag
643− clientWithRoute Proxy =
645+ clientWithRouteAndResultHandler Proxy =
644− clientWithRoute (Proxy :: Proxy (Verb method status ctypes (Envelope es a)))
646+ clientWithRouteAndResultHandler (Proxy :: Proxy (Verb method status ctypes (Envelope es a)))
645
647
646-- | When 'NoThrow' comes before a 'Verb', change it into the same 'Verb'
648-- | When 'NoThrow' comes before a 'Verb', change it into the same 'Verb'
647-- but returning an @'Envelope' \'[]@.
649-- 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) =>
649 HasClient t m (NoThrow :> Verb method status ctypes a) tag where
651 HasClient t m (NoThrow :> Verb method status ctypes a) tag where
650
652
651 type Client t m (NoThrow :> Verb method status ctypes a) tag =
653 type Client t m (NoThrow :> Verb method status ctypes a) tag =
652 Client t m (Verb method status ctypes (Envelope '[] a)) tag
654 Client t m (Verb method status ctypes (Envelope '[] a)) tag
653
655
654− clientWithRoute
656+ clientWithRouteAndResultHandler
655 :: Proxy (NoThrow :> Verb method status ctypes a)
657 :: Proxy (NoThrow :> Verb method status ctypes a)
656 -> Proxy m
658 -> Proxy m
657 -> Proxy tag
659 -> Proxy tag
658 -> Req t
660 -> Req t
659 -> Dynamic t BaseUrl
661 -> Dynamic t BaseUrl
660 -> ClientOptions
662 -> ClientOptions
663+ -> (forall x. Event t (ReqResult tag x) -> m (Event t (ReqResult tag x)))
661 -> Client t m (Verb method status ctypes (Envelope '[] a)) tag
664 -> Client t m (Verb method status ctypes (Envelope '[] a)) tag
662− clientWithRoute Proxy =
665+ clientWithRouteAndResultHandler Proxy =
663− clientWithRoute (Proxy :: Proxy (Verb method status ctypes (Envelope '[] a)))
666+ clientWithRouteAndResultHandler (Proxy :: Proxy (Verb method status ctypes (Envelope '[] a)))
664
667
665-- | When @'Throwing' es@ comes before ':<|>', push @'Throwing' es@ into each
668-- | When @'Throwing' es@ comes before ':<|>', push @'Throwing' es@ into each
666-- branch of the API.
669-- 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) =>
668 HasClient t m (Throwing es :> (api1 :<|> api2)) tag where
671 HasClient t m (Throwing es :> (api1 :<|> api2)) tag where
669
672
670 type Client t m (Throwing es :> (api1 :<|> api2)) tag =
673 type Client t m (Throwing es :> (api1 :<|> api2)) tag =
671 Client t m ((Throwing es :> api1) :<|> (Throwing es :> api2)) tag
674 Client t m ((Throwing es :> api1) :<|> (Throwing es :> api2)) tag
672
675
673− clientWithRoute
676+ clientWithRouteAndResultHandler
674 :: Proxy (Throwing es :> (api1 :<|> api2))
677 :: Proxy (Throwing es :> (api1 :<|> api2))
675 -> Proxy m
678 -> Proxy m
676 -> Proxy tag
679 -> Proxy tag
677 -> Req t
680 -> Req t
678 -> Dynamic t BaseUrl
681 -> Dynamic t BaseUrl
679 -> ClientOptions
682 -> ClientOptions
683+ -> (forall a. Event t (ReqResult tag a) -> m (Event t (ReqResult tag a)))
680 -> Client t m ((Throwing es :> api1) :<|> (Throwing es :> api2)) tag
684 -> Client t m ((Throwing es :> api1) :<|> (Throwing es :> api2)) tag
681− clientWithRoute _ =
685+ clientWithRouteAndResultHandler _ =
682− clientWithRoute (Proxy :: Proxy ((Throwing es :> api1) :<|> (Throwing es :> api2)))
686+ clientWithRouteAndResultHandler (Proxy :: Proxy ((Throwing es :> api1) :<|> (Throwing es :> api2)))
683
687
684-- | When 'NoThrow' comes before ':<|>', push 'NoThrow' into each branch of the
688-- | When 'NoThrow' comes before ':<|>', push 'NoThrow' into each branch of the
685-- API.
689-- API.
686−instance HasClient t m ((NoThrow :> api1) :<|> (NoThrow :> api2)) tag =>
690+instance (Monad m, HasClient t m ((NoThrow :> api1) :<|> (NoThrow :> api2)) tag) =>
687 HasClient t m (NoThrow :> (api1 :<|> api2)) tag where
691 HasClient t m (NoThrow :> (api1 :<|> api2)) tag where
688
692
689 type Client t m (NoThrow :> (api1 :<|> api2)) tag =
693 type Client t m (NoThrow :> (api1 :<|> api2)) tag =
690 Client t m ((NoThrow :> api1) :<|> (NoThrow :> api2)) tag
694 Client t m ((NoThrow :> api1) :<|> (NoThrow :> api2)) tag
691
695
692− clientWithRoute
696+ clientWithRouteAndResultHandler
693 :: Proxy (NoThrow :> (api1 :<|> api2))
697 :: Proxy (NoThrow :> (api1 :<|> api2))
694 -> Proxy m
698 -> Proxy m
695 -> Proxy tag
699 -> Proxy tag
696 -> Req t
700 -> Req t
697 -> Dynamic t BaseUrl
701 -> Dynamic t BaseUrl
698 -> ClientOptions
702 -> ClientOptions
703+ -> (forall a. Event t (ReqResult tag a) -> m (Event t (ReqResult tag a)))
699 -> Client t m ((NoThrow :> api1) :<|> (NoThrow :> api2)) tag
704 -> Client t m ((NoThrow :> api1) :<|> (NoThrow :> api2)) tag
700− clientWithRoute _ =
705+ clientWithRouteAndResultHandler _ =
701− clientWithRoute (Proxy :: Proxy ((NoThrow :> api1) :<|> (NoThrow :> api2)))
706+ clientWithRouteAndResultHandler (Proxy :: Proxy ((NoThrow :> api1) :<|> (NoThrow :> api2)))
702
707
703-- | When a @'Throws' e@ comes immediately after a @'Throwing' es@, 'Snoc' the
708-- | When a @'Throws' e@ comes immediately after a @'Throwing' es@, 'Snoc' the
704-- @e@ onto the @es@. Otherwise, if @'Throws' e@ comes before any other
709-- @e@ onto the @es@. Otherwise, if @'Throws' e@ comes before any other
705-- combinator, push it down so it is closer to the 'Verb'.
710-- 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) =>
707 HasClient t m (Throwing es :> api :> apis) tag where
712 HasClient t m (Throwing es :> api :> apis) tag where
708
713
709 type Client t m (Throwing es :> api :> apis) tag =
714 type Client t m (Throwing es :> api :> apis) tag =
710 Client t m (ThrowingNonterminal (Throwing es :> api :> apis)) tag
715 Client t m (ThrowingNonterminal (Throwing es :> api :> apis)) tag
711
716
712− clientWithRoute
717+ clientWithRouteAndResultHandler
713 :: Proxy (Throwing es :> api :> apis)
718 :: Proxy (Throwing es :> api :> apis)
714 -> Proxy m
719 -> Proxy m
715 -> Proxy tag
720 -> Proxy tag
716 -> Req t
721 -> Req t
717 -> Dynamic t BaseUrl
722 -> Dynamic t BaseUrl
718 -> ClientOptions
723 -> ClientOptions
724+ -> (forall a. Event t (ReqResult tag a) -> m (Event t (ReqResult tag a)))
719 -> Client t m (ThrowingNonterminal (Throwing es :> api :> apis)) tag
725 -> Client t m (ThrowingNonterminal (Throwing es :> api :> apis)) tag
720− clientWithRoute _ =
726+ clientWithRouteAndResultHandler _ =
721− clientWithRoute (Proxy :: Proxy (ThrowingNonterminal (Throwing es :> api :> apis)))
727+ clientWithRouteAndResultHandler (Proxy :: Proxy (ThrowingNonterminal (Throwing es :> api :> apis)))
722
728
723-- | When 'NoThrow' comes before any other combinator, push it down so it is
729-- | When 'NoThrow' comes before any other combinator, push it down so it is
724-- closer to the 'Verb'.
730-- closer to the 'Verb'.
725−instance HasClient t m (api :> NoThrow :> apis) tag =>
731+instance (Monad m, HasClient t m (api :> NoThrow :> apis) tag) =>
726 HasClient t m (NoThrow :> api :> apis) tag where
732 HasClient t m (NoThrow :> api :> apis) tag where
727
733
728 type Client t m (NoThrow :> api :> apis) tag =
734 type Client t m (NoThrow :> api :> apis) tag =
729 Client t m (api :> NoThrow :> apis) tag
735 Client t m (api :> NoThrow :> apis) tag
730
736
731− clientWithRoute
737+ clientWithRouteAndResultHandler
732 :: Proxy (NoThrow :> api :> apis)
738 :: Proxy (NoThrow :> api :> apis)
733 -> Proxy m
739 -> Proxy m
734 -> Proxy tag
740 -> Proxy tag
735 -> Req t
741 -> Req t
736 -> Dynamic t BaseUrl
742 -> Dynamic t BaseUrl
737 -> ClientOptions
743 -> ClientOptions
744+ -> (forall a. Event t (ReqResult tag a) -> m (Event t (ReqResult tag a)))
738 -> Client t m (api :> NoThrow :> apis) tag
745 -> Client t m (api :> NoThrow :> apis) tag
739− clientWithRoute _ =
746+ clientWithRouteAndResultHandler _ =
740− clientWithRoute (Proxy :: Proxy (api :> NoThrow :> apis))
747+ clientWithRouteAndResultHandler (Proxy :: Proxy (api :> NoThrow :> apis))
741
748